Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_print_a11y_script - use passive eventlisteners and use pointerdown #666

Open
diggeddy opened this issue Feb 26, 2025 · 0 comments
Labels
feature Features, refactoring, enhancements, improvements triage Awaiting review
Milestone

Comments

@diggeddy
Copy link
Collaborator

Description

Reduce INP impact of script by making event listeners passive.
Use pointerdown to work with touch devices.

eg.

!function(){"use strict";var e=document.body;e.addEventListener("pointerdown",()=>e.classList.add("using-mouse"),{passive:!0}),e.addEventListener("keydown",()=>e.classList.remove("using-mouse"),{passive:!0});}();

Related to #659

@diggeddy diggeddy added the feature Features, refactoring, enhancements, improvements label Feb 26, 2025
@diggeddy diggeddy added this to the 3.6.0 milestone Feb 26, 2025
@github-actions github-actions bot added the triage Awaiting review label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features, refactoring, enhancements, improvements triage Awaiting review
Projects
None yet
Development

No branches or pull requests

1 participant