Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55988 closed enhancement (duplicate)

touchStart events should be passive

Reported by: joostdevalk's profile joostdevalk Owned by: joostdevalk's profile joostdevalk
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords: reporter-feedback has-patch
Focuses: javascript, performance Cc:

Description

Browsers can't know if an event listener, like touchStart will prevent scrolling, so they always wait for the listener to finish executing before scrolling the page. Making them passive allows for scrolling to continue properly.

See this doc for further explanation.

Change History (4)

#1 follow-up: @peterwilsoncc
2 years ago

  • Keywords reporter-feedback added; has-patch removed
  • Milestone changed from 6.0.1 to Awaiting Review

Are you able to provide further information:

  • which events are you referring to?
  • was this a regression introduced in the 6.0 cycle?

I notice this is on the comment component, if you are referring to the comment reply script then this ticket should be closed as a duplicate of #47510.

Last edited 2 years ago by peterwilsoncc (previous) (diff)

This ticket was mentioned in PR #2818 on WordPress/wordpress-develop by jdevalk.


2 years ago
#2

  • Keywords has-patch added

Brought to light by recent Lighthouse updates, we should make the touchStart events in our comment reply script passive.

See https://web.dev/uses-passive-event-listeners/ for background and explanation.

Trac ticket: https://core.trac.wordpress.org/ticket/55988

This might affect (and partially fix) https://core.trac.wordpress.org/ticket/46713

#3 in reply to: ↑ 1 @SergeyBiryukov
2 years ago

Replying to peterwilsoncc:

I notice this is on the comment component, if you are referring to the comment reply script then this ticket should be closed as a duplicate of #47510.

Yes, PR 2818 appears to be the same as the patch on #47510. I have updated the PR description to link to this ticket, as it was only linked to #46713, due to mentioning that ticket first.

#4 @peterwilsoncc
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #47510.

Thanks @SergeyBiryukov, in that case I will close this as a duplicate of the original ticket. There are multiple comments on that ticket explaining what needs to change in order to the event to be compatible with passive events.

Note: See TracTickets for help on using tickets.