I would love to see support for passive event listeners. I imagine it working like:
<div @mousedown.passive="interactive = true">
It looks like it should be pretty easy to implement as x-on is already creating an event listener for the element.
https://github.com/alpinejs/alpine/blob/5181242588436f58c3ea19cd0e45d6dcbe29f853/src/directives/on.js#L22
_Originally posted by @alex-page in https://github.com/alpinejs/alpine/discussions/557_
Bear in mind the following:
Otherwise all the code changes should be localised to the on.js file you've mentioned.
Google Lighthouse dings my site for not using a passive scroll listener and I don鈥檛 support IE11, so I would appreciate this.
Will look at a PR for this one this weekend.
@ryangjchandler did you end up working on this? I might pick this up at some point next week otherwise 馃槃
@ryangjchandler did you end up working on this? I might pick this up at some point next week otherwise 馃槃
Yeah, wrapping up the PR. Will submit tomorrow 馃馃徏
@ryangjchandler just so we aren't blocking anyone are you able to put up a draft PR?
@alex-page didn't get around to doing this - @HugoDF did you wanna have a crack?
Sure thing
Most helpful comment
Yeah, wrapping up the PR. Will submit tomorrow 馃馃徏