Skip to content

perf: passive event listener for focus visible - #27568

Merged
liamdebeasi merged 1 commit into
mainfrom
FW-4463
May 30, 2023
Merged

liamdebeasi merged 1 commit into
mainfrom
FW-4463

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented May 30, 2023 •

Copy link
Copy Markdown
Contributor

Issue number: resolves #27566


What is the current behavior?

The touchstart listener for focus visible is not marked as passive. This causes a browser delay in case touchstart calls ev.preventDefault(). However, we are not doing that in this block of code.

What is the new behavior?

  • Added passive: true to the touchstart listener to avoid the browser delay.

Note that this is only needed for touch and wheel events which is why I only modified touchstart: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

Does this introduce a breaking change?

  • Yes
  • No

Other information

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions Bot added the package: core @ionic/core package label May 30, 2023
@liamdebeasi
liamdebeasi marked this pull request as ready for review May 30, 2023 13:16
@liamdebeasi
liamdebeasi requested a review from a team as a code owner May 30, 2023 13:16
@liamdebeasi
liamdebeasi requested review from thetaPC and removed request for a team May 30, 2023 13:16

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liamdebeasi
liamdebeasi added this pull request to the merge queue May 30, 2023
Merged via the queue into main with commit e54bf14 May 30, 2023
@liamdebeasi
liamdebeasi deleted the FW-4463 branch May 30, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: focus visible needs passive touchstart listener

2 participants