-
Notifications
You must be signed in to change notification settings - Fork 14
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
doubleTapThreshold prop breaks touch events on SVG. #5
Comments
Oh, I see. Hadn't thought about this interaction. Should probably document it, or figure out a better solution. I guess you're not in need of the double tap function. I'll look around a bit for how or if this has been solved in other contexts to allow both double tap to zoom and interact with ancestors, I guess it might be enough to move the check for double taps into shouldRespond, just feels like the wrong place to add side-effects. |
Is the double tap zoom a thing or how would I implement it? |
Well, if you only need double tap zoom, it should be enough to give a non-zero value to doubleTapThreshold, and if you want events to go to the underlying svg content you need to set it to zero. Otherwise, the shouldRespond logic needs to be adapted to the needs. |
@msand, could you describe how to move the check for the double taps into shouldRespond or other methods to make children elements recieve touches while doubleTapThreshold is set? Your help would be very appreciated! |
When the doubleTapThreshold prop is set, touch events never get passed through to the underlying SVG.
shouldRespond
returns a truthy value when doubleTapThreshold is set, causing the view to always set the pan responder.In my case I removed doubleTapThreshold from ZoomableSvg props.
If this is by design, could you add to the homepage docs?
Thanks for your great work @msand, saved me many hours!
The text was updated successfully, but these errors were encountered: