Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cursor not showing when tabbing into multiline TextInput (#1342)
This bug happens because `RCTUITextView` (which multiline TextInput uses) was overriding NSTextView's `becomeFirstResponder` method and didn't call `[super becomeFirstResponder]`. This seems to mess with AppKit's logic of drawing the cursor initially. This is alluded to in the [docs](https://developer.apple.com/documentation/appkit/nstextview/1807130-becomefirstresponder?language=objc#) for `[NSTextView becomeFirstResponder]`: > If the previous first responder was not a text view on the same layout manager as the receiving text view, this method draws the selection and updates the insertion point if necessary. Simply switching to call `[super becomeFirstResponder]` led to a cryptic exception within AppKit. This was likely because in the `reactFocus` (and `reactFocusIfNeeded`) we were calling `becomeFirstResponder` directly. The [docs](https://developer.apple.com/documentation/appkit/nsresponder/1526750-becomefirstresponder?language=objc#) for `[NSResponder becomeFirstResponder]` say: > Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly. This fixed the issue Co-authored-by: Liron Yahdav <lyahdav@fb.com>
- Loading branch information