Repository navigation
Fix iOS multiline TextInput style updates after emoji insertion - #60137
Open
FeliksLv01 wants to merge 2 commits into
Open
FeliksLv01 wants to merge 2 commits into
FeliksLv01 wants to merge 2 commits into
Conversation
FeliksLv01
force-pushed
the
fix/ios-textinput-emoji-attributes
branch
from
November 19, 2026 08:17
80f8d15 to
9081787
Compare
Visual regressionNo visual differences at |
Compare styles with the last React snapshot applied to the native multiline input so rejected updates cannot hide later style changes.
This branch has not been deployed
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 #60089 for multiline
TextInputon iOS Fabric. When UIKit reports a fallback font throughNSOriginalFont, the existing plain-text comparison can skip style changes in nested<Text>children.Stale events. Start with black text (
eventCount = 1), send a stale red update (0), then send a valid red update with an underline (1). The stale update is rejected, so UIKit still has black text. Fabric can pass that rejected red state asoldStatefor the final update. Diffing against it detects only the underline and leaves the text black.Implementation. For style-only updates, compare the incoming React styles by range against the last React styles applied to the multiline input. Update changed attributes in place on
UITextView.textStorage. A successful React write or a native text echo with equivalent styles updates that snapshot. Rejected events and styles deferred by input-method guards leave it intact. Comparing React styles avoids treating UIKit font fallback or React event-emitter metadata as style changes and preserves both selection endpoints.Changelog:
[IOS] [FIXED] - Apply style-only updates to multiline TextInput on iOS Fabric when the text contains an emoji.
Test Plan:
RCTTextInputComponentViewTestspassed. The stale-event regression verifies that the rejected update leaves the text black and the next valid update applies both red and the underline. The other tests cover style updates with simulated UIKit font fallback, a native text echo with font fallback, and equivalent styles.<Text>. The adjacent text stayed blue. A toggle withHelloselected preserved the native selection range[0, 5].onChange. After selecting你好, the candidate appeared in the input andHelloturned red.NSOriginalFontexplicitly to exercise the reported path.XCTest command
Simulator screenshots
Color toggle with ✅ (controlled reproduction)
In both RNTester builds, tap Add ✅, then Toggle color. The status below the input shows
Color red. The test harness suppliedNSOriginalFonton ✅ to simulate UIKit font fallback.Pinyin composition (with the fix)