You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that you support a config value for { event: { passive: true } }. However in the basic usage of useGesture (and others), your package doesn't actually do the event binding. So the event binding ends up not being passive except for the few global bindings (for drag).
I think this is fine and once you return the bindings its outside this packages scope.
The good news is that since you already support binding to external dom/refs, this issue is already resolved! Using the domTarget config will actually bring binding back into the hooks scope!
I fought this issue for a longer than I should have, and wish I'd have found an issue like this one while I was searching... So I'm creating it! :)
Feel free to close, but if we're looking for a resolution, I think we could add a note in the readme stating that the passive config value will only apply to most of your bindings if you use { domTarget: myRef } and React.useEffect(bind, [bind])
I could PR the issue to FAQ, but i'm not sure how F it is :)
The text was updated successfully, but these errors were encountered:
EDIT: actually I'm not even sure about this. It looks like touch events are treated passive by default...
EDIT2: this thread. At the end of the day, for clarity’s sake, maybe passive shouldn’t be an option except when domTarget is used and when we can actually control listeners behavior without worrying about React.
Feel free to add an item to the FAQ, might not be very frequent but it's been in the back of my head for a while, it would be great if it was clarified once and for all!
Hey guys, your project rocks.
I noticed that you support a config value for
{ event: { passive: true } }
. However in the basic usage ofuseGesture
(and others), your package doesn't actually do the event binding. So the event binding ends up not being passive except for the few global bindings (for drag).I think this is fine and once you return the bindings its outside this packages scope.
The good news is that since you already support binding to external dom/refs, this issue is already resolved! Using the
domTarget
config will actually bring binding back into the hooks scope!I fought this issue for a longer than I should have, and wish I'd have found an issue like this one while I was searching... So I'm creating it! :)
Feel free to close, but if we're looking for a resolution, I think we could add a note in the readme stating that the
passive
config value will only apply to most of your bindings if you use{ domTarget: myRef }
andReact.useEffect(bind, [bind])
I could PR the issue to FAQ, but i'm not sure how F it is :)
The text was updated successfully, but these errors were encountered: