-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support for passive event listeners #74
Comments
It looks like all the event listeners are passive by default. I'm trying to find out how to make an event listener active so that I can cancel a touchmove event during scrolling. |
Ah.. I just see your issue now... Is this resolved? |
Hi jerrybendy, I ended up just using the native vue v-on:touchmove and v-on:mousemove to get active event listeners instead of the v-touch:moving. I didn't find a way to get active event listeners with your library. If there is a way please let me know. |
I don't know what the I think, do you mean, the event object? I visited my code, all events didn't send the original event object . It's a pity... |
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener target.addEventListener(type, listener [, options]); options: passive When I said active event listener I was meaning that the option passive = false is being passed to the event listener so that event.preventDefault() may be called. |
I know every word, but I can't understand this sentence well. 😓 Sorry about that. As I understand it, you want to change the |
Ah yes, you do understand what I am asking. I took your advice to make a |
To answer the OP, if you look at the code you will see that there is a check if the browser does support passive the boolean returned from this is used to set if the event listener is passive: true or false |
Good job! 👍 Could you send a PR to me? I'm very glad to merge it. |
@oldbootz I have simplified your code (merge two |
VueJS offers a
.passive
to make an event listener passive to improve performance https://vuejs.org/v2/guide/events.html#main , is there a way to achieve the same with this library?The text was updated successfully, but these errors were encountered: