ValentinH / svelte-easy-crop

A Svelte component to crop images with easy interactions
https://codesandbox.io/s/svelte-easy-crop-basic-demo-q1005?file=/App.svelte
MIT License
199 stars 31 forks source link

add nonpassive event modifier to mouse wheel and touchstart event lis… #55

Closed ronkeiser closed 3 months ago

ronkeiser commented 3 months ago

Problem

Chrome complains of non-passive event listener violations if certain listeners are not explicitly marked as non-passive. It's kind of dumb:

svelte-easy-crop-console

Solution

We can get rid of this warning by adding the nonpassive event modifier like so:

 on:wheel|nonpassive|preventDefault={onWheel}

This PR adds two modifiers to clean up the console warnings when using svelte-easy-crop in Chrome.

ValentinH commented 3 months ago

Thanks for this PR. It was published as https://github.com/ValentinH/svelte-easy-crop/releases/tag/v2.0.4