Skip to content
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

fix: properly handle touch events outside the Svg #2611

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

jakex7
Copy link
Member

@jakex7 jakex7 commented Jan 14, 2025

Summary

Fixes #2585

Improve the onPress events by ignoring touches outside the Svg view. This is implemented as follows:

  • on Android by clipping the Android's element dimensions to (0, 0, canvas width, canvas height)
  • on Apple by improving hitTest to exclude touches outside the bounds of (0, 0, bounds width, bounds height)
Nagranie.z.ekranu.2025-01-15.o.10.45.22.mov

@jakex7 jakex7 changed the title fix: clip dimensions to root svg bounds to preoperly handle touch events fix: preoperly handle touch events outside the Svg Jan 15, 2025
@jakex7 jakex7 changed the title fix: preoperly handle touch events outside the Svg fix: properly handle touch events outside the Svg Jan 15, 2025
@jakex7 jakex7 requested a review from latekvo January 15, 2025 09:57
Copy link
Contributor

@latekvo latekvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jakex7 jakex7 merged commit de8a763 into main Jan 15, 2025
5 of 9 checks passed
@jakex7 jakex7 deleted the @jakex7/clipElementInspectorToSvgBounds branch January 15, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RenderableViews inside SvgView call onPress when pressed outside of SvgView
2 participants