Skip to content

fix: properly handle touch events outside the Svg#2611

Merged
jakex7 merged 3 commits intomainfrom
@jakex7/clipElementInspectorToSvgBounds
Jan 15, 2025
Merged

fix: properly handle touch events outside the Svg#2611
jakex7 merged 3 commits intomainfrom
@jakex7/clipElementInspectorToSvgBounds

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
Member

@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