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

[Bug] preventing brower zoom in svelte5 using onwheel #13318

Closed
GetCurious opened this issue Sep 19, 2024 · 4 comments · Fixed by #13322
Closed

[Bug] preventing brower zoom in svelte5 using onwheel #13318

GetCurious opened this issue Sep 19, 2024 · 4 comments · Fixed by #13322

Comments

@GetCurious GetCurious changed the title [Bug] preventing brower zoom in svelte5 using onwheel [Bug] preventing brower zoom in svelte5 using onwheel Sep 19, 2024
@Prinzhorn
Copy link
Contributor

See discussion in #12639

@GetCurious
Copy link
Author

so i'm guessing Rich is saying here, onwheel will not receive {passive:false} by default?
if so i will not be upgrading to svelte 5.
thanks

@webJose
Copy link

webJose commented Sep 19, 2024

This is interesting because MDN states that the events are passive by default only on window, document and document.body. Shouldn't Svelte adhere to this list exactly? I saw the PR and states the change was made "to align with browsers", but if the listener is made passive for all elements, that's not being aligned. Apologies for the interjection. The topic caught my eye.

@GetCurious
Copy link
Author

passive

If this option is not specified it defaults to false

right, i think onwheel={myFunc} should reflect element.addEventListener('wheel', myFunc)
sry rant, but maybe delay this to svelte 6? why so much changes in one version?

dummdidumm added a commit that referenced this issue Sep 19, 2024
This was done previously to align with browser behavior, but the browser behavior actually only makes them passive on window/document/body. Since wheel events are not delegated, we can revert their passive-by-default setting. Closes #13318

For touchstart/touchmove we're not changing it because these events are delegated, which means they happen a lot more often on a target higher up the tree, which may cause jank.
Rich-Harris pushed a commit that referenced this issue Sep 19, 2024
This was done previously to align with browser behavior, but the browser behavior actually only makes them passive on window/document/body. Since wheel events are not delegated, we can revert their passive-by-default setting. Closes #13318

For touchstart/touchmove we're not changing it because these events are delegated, which means they happen a lot more often on a target higher up the tree, which may cause jank.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants