fix(fabric): implement missing TextInput commands for macOS#2912
Draft
Saadnajmi wants to merge 1 commit intomicrosoft:mainfrom
Draft
fix(fabric): implement missing TextInput commands for macOS#2912Saadnajmi wants to merge 1 commit intomicrosoft:mainfrom
Saadnajmi wants to merge 1 commit intomicrosoft:mainfrom
Conversation
- Add setGhostText command to Fabric TextInput native handler (was declared in JS but missing from native dispatch) - Port ghost text implementation from Paper to Fabric with proper Fabric API adaptations (NSRange selection, direct _backedTextInputView access) - Fix setTextAndSelection using notifyDelegate:YES instead of NO, matching Paper behavior to prevent spurious delegate callbacks - Add ghost text cleanup in textInputDidChange delegate - Add RNTesterPlayground test case for verifying TextInput ref and commands (focus, blur, clear, setSelection, setGhostText) - Add debug logging in setLocalRef to diagnose ref null issue - Add test assertions for setSelection and setGhostText methods Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
setGhostTextcommand to Fabric TextInput — was declared in JSsupportedCommandsbut completely missing from the native Fabric command handler (RCTTextInputNativeCommands.h). Ported full implementation from Paper (RCTBaseTextInputView.mm) with Fabric API adaptations.setTextAndSelectionon macOS — changednotifyDelegate:YEStonotifyDelegate:NOto match Paper behavior, preventing spurious delegate callbacks during programmatic selection changes from JS.textInputDidChangewhen user types, preventing ghost text from leaking into JS state.__DEV__logging insetLocalRefto help diagnose the reported ref-is-null issue at runtime.Test plan
setSelectionsets selection without triggering extra selection change eventsjest TextInput-test.js— new assertions forsetSelectionandsetGhostTextinstance methodsTextInput.jsbefore merging🤖 Generated with Claude Code