-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add default passive logic to all components #83
Comments
I wonder if this might be causing the FOUC with Sapper. |
Does adding an event listener ever cause a render? |
I'm using it with sveltejs, not tested yet with sapper, but adding |
|
There is no rerender, when you call |
You can also see this repo: default-passive-events. |
Done! This is now an option when you bind to events in SMUI: <Card on:wheel:passive={myPassiveHandler}>
...
</Card> Do note that event modifiers on SMUI components have a slightly different syntax (":") than event modifiers on DOM elements ("|"). <!-- SMUI component: -->
<Button on:click:preventDefault:capture={myHandler}>Click me</Button>
<!-- DOM element: -->
<button on:click|preventDefault|capture={myHandler}>Click me</button> |
To avoid chrome warnings about passive events you can use this (since sveltejs cannot add modifiers to
on:***
listeners to no DOM elements (except once), the default behavior can be passive and no capturing by default):detectPassiveEvents.js
on@smui/common
to detect passive-events:@smui/common/forwardEvents.js
with:Bye.
The text was updated successfully, but these errors were encountered: