fix: unable to move cursor in absolutely positioned TextInput on Android when parent View has zIndex #52290
+44
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
To fix #51469
I found in this scenario, a ghost container with no width and height is created. My touch events seem to be intercepted and never reach ReactEditText, the onTouchEvent in ReactEditText is not triggered at all.
This is a workaround approach, finds the targetView through touch coordinates and manually trigger onTouchEvent.
Not perfect, but currently solves my problem. I suspect this issue is related to the zIndex implementation on Android.
Changelog:
[ANDROID] [FIXED] - Fix TextInput cursor positioning when absolutely positioned inside parent with zIndex
Test Plan
Repro provided in #51469