You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(iOS): Text replacement and autocorrect attributes re-stamping - #888
it accidentally properly extended attributes when replacing range of characters (but it wasn't meant to be doing this)
The fix addresses all three issues:
we calculate precise range to re-stamp
we don't just blindly copy attributes; only our custom ones are grabbed and the ones that are non extensible (links, mentions, images) are skipped
the re-stamping now doesn't fix the attributes when user manually replaces a range of characters - now it's done independently via existing attributesManager methods only when we're sure no autocorrects/spellchecks are in play
Test Plan
try replacing a bold word with a letter - it should be bold
if you try replacing a partially bold word with a letter it will be plain (bold didn't span the whole selection)
autocorrect/spellcheck/predictive typing should all keep formatting
mentions/links can't be extended by selecting them as a whole and typing something
Screenshots / Videos
Screen.Recording.2026-11-27.at.15.14.47.mov
Compatibility
OS
Implemented
iOS
✅
Android
❌
Web
❌
Checklist
E2E tests are passing
Required E2E tests have been added (if applicable)
Reviewing files that changed from the base of the PR and between 8d1a0bc and 14fd960.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
No new commits to review - use @coderabbitai full review for a full pass
No actionable comments were generated in the recent review.
Walkthrough
The iOS text input now captures eligible attributes for autocorrect and predictive replacements at a collapsed caret, extends typing attributes from selected text for nonempty replacements, and restamps captured attributes only within the recorded replacement range clipped to text storage.
Changes: iOS replacement attribute handling
Layer / File(s)
Summary
Typing attribute restoration API ios/inputAttributesManager/InputAttributesManager.h, ios/inputAttributesManager/InputAttributesManager.mm
InputAttributesManager adds extendTypingAttributesFromReplacedRange:. It restores eligible inline styles from an in-bounds range into a copy of the current typing attributes.
Replacement attribute capture and restamping ios/EnrichedTextInputView.mm
The view records the replacement range and selectively captures attributes for nonempty replacements at a collapsed caret. For selection replacements, it extends typing attributes from the replaced range. Restamping uses the recorded range clipped to text storage bounds.
software-mansion/react-native-enriched-html#855 — The issue concerns mention attributes during iOS typing or autocorrect. This change skips non-extensible attributes such as mentions during capture, but the summaries do not confirm that it fixes mention stripping.
Suggested reviewers:kacperzolkiewski
Merge Risk: Minimal · previous review 8d1a0
This change narrows iOS attribute re-stamping after autocorrect and spell-check, so links and mentions no longer spread. No concrete merge-blocking risk was found. Run the author's manual formatting checks on a device before release.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the iOS scope and the re-stamping of text replacement and autocorrect attributes, which matches the changeset. It is specific, and a teammate scanning history would understand the main…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description states the PR fixes iOS autocorrect, spell-check, and predictive text attribute re-stamping. It names the three issues addressed: over-broad re-stamping range, links and mentions sprea…
Full details: Title check
Explanation
The title names the iOS scope and the re-stamping of text replacement and autocorrect attributes, which matches the changeset. It is specific, and a teammate scanning history would understand the main change from it.
Full details: Description check
Explanation
The description states the PR fixes iOS autocorrect, spell-check, and predictive text attribute re-stamping. It names the three issues addressed: over-broad re-stamping range, links and mentions spreading, and attributes extending on manual range replacement. It also gives a test plan and platform compatibility table. The description matches the changeset, which adds range-precise re-stamping and extendTypingAttributesFromReplacedRange in the iOS files.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
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
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
An iOS fix a while ago made all:
re-stamp attributes after they're done so that we don't lose formatting.
However it had a few issues;
The fix addresses all three issues:
attributesManagermethods only when we're sure no autocorrects/spellchecks are in playTest Plan
Screenshots / Videos
Screen.Recording.2026-11-27.at.15.14.47.mov
Compatibility
Checklist