fix(android): attach missing events#53
Merged
Merged
Conversation
…hange, onScroll and onKeyPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes
onSelectionChange,onContentSizeChange,onScroll, andonKeyPresson Android Fabric — they were silently no-op for<PasteTextInput>.Root cause
ReactTextInputManagergates these four listeners behind boolean@ReactProps (e.g.setOnSelectionChange(view, true)attaches the watcher). RN's built-in<TextInput>works because it ships a hand-written ViewConfig that lists these handlers asvalidAttributes, so React serializes them as boolean props when JS handlers are present.Codegen-based components like
<PasteTextInput>don't get that — the handlers are only registered as direct/bubbling events, never as attributes — so the Java setters never fire and the watchers stay unattached.Fix
In
PasteTextInputManager.addEventEmitters, attach all four watchers unconditionally. This matches built-in<TextInput>'s actual behaviour: it always passes its internal_onSelectionChangeto the native side regardless of whether the user provided a handler, so the watchers are effectively always-on there too.