localvoid / ivi

Lighweight Embeddable Web UI Library
MIT License
723 stars 22 forks source link

passive listeners? #52

Closed leeoniya closed 1 year ago

leeoniya commented 1 year ago

i've seen @scroll:passive=${onScroll} proposed before, which i'm a fan of

other:

https://terodox.tech/lit-html-part-3/#event-listener-options https://github.com/zzarcon/default-passive-events

if ivi made some events passive by default, that would be even better, but also magical :(

https://github.com/zzarcon/default-passive-events/blob/664c0d25cdb81a4f78f589321e613971e8279cf8/src/index.js#L7-L11

i don't think all of these are needed, just the ones that can fire hundreds of events per sec:

mousemove touchmove drag scroll resize

localvoid commented 1 year ago

IIRC scroll can't be canceled. Other events are usually added imperatively in the mousedown, etc event handlers.

I thought about it, and I think that it is not that useful in practice.

leeoniya commented 1 year ago

k, i'll re-open this if testing with https://github.com/zzarcon/default-passive-events reveals anything interesting in actual use.