-
-
Notifications
You must be signed in to change notification settings - Fork 914
-
-
Notifications
You must be signed in to change notification settings - Fork 914
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
Support 'passive' option on event listeners #2210
Labels
enhancement
New feature or request
Comments
goswinr
changed the title
Support Passive Event Listeners
Support 'passive' option on event listeners
Jul 5, 2024
Great suggestion. How are other frameworks handling it. Love to see some inspiration for this feature. |
+1 |
This is very important. Otherwise, do we have to use addEventListener temporarily? |
@chaosprint yes, currently you have to use |
Opened this PR to solve this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Most DOM events are not passive by default, but some are ( wheel, scroll, ..) .
see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#passive
And it is not consistent among major Browsers.
Should Solids JSX support explicit passive options for event listeners ?
See how React addressed this issue: facebook/react#6436 and the resolution: facebook/react#19654
Steps to Reproduce the Bug or Issue
see example on SolidJS Playground and below: (update Sep 2024: on chrome the playground doesn't show the bug anymore)
Expected behavior
Like
on:*
andoncapture:*
There could be a JSX syntax to specify the passive option for events. Maybe
onpassive:*
andonnotpassive: *
oronWheelNotPassive
andonScrollNotPassive
The text was updated successfully, but these errors were encountered: