Skip to content

Defer transformed TextInput edits outside UIKit delegate callbacks (#59188) - #59188

Closed
javache wants to merge 1 commit into
react:mainfrom
javache:export-D126057002
Closed

javache wants to merge 1 commit into
react:mainfrom
javache:export-D126057002

Conversation

@javache

@javache javache commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

UIKit text change delegate callbacks now remain decision-only when JavaScript transforms an edit. The adapter rejects UIKit's original edit, records an implementation-private transaction, and applies an incremental UITextInput replacement on the next main-queue turn after validating the backing-view generation and base text.

This preserves partial maxLength truncation without synchronously replacing the full attributed string or selection. Marked-text composition remains UIKit-owned; an over-limit committed value is corrected through the same deferred transaction path after composition ends. A runtime gate controls the new path.

Stale edits are discarded when the backing text changes, lifecycle and JavaScript-driven updates invalidate queued transactions, and successful commits emit one change update plus the corresponding selection event.

Changelog:
[iOS][Fixed] - Preserve transformed TextInput edits without synchronously rewriting text inside UIKit delegate callbacks

Reviewed By: cipolleschi

Differential Revision: D126057002

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 19, 2026
@meta-codesync

meta-codesync Bot commented Oct 19, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126057002.

@meta-codesync meta-codesync Bot changed the title Defer transformed TextInput edits outside UIKit delegate callbacks Defer transformed TextInput edits outside UIKit delegate callbacks (#59188) Oct 19, 2026
javache added a commit to javache/react-native that referenced this pull request Oct 19, 2026
…eact#59188)

Summary:
Pull Request resolved: react#59188

UIKit text change delegate callbacks now remain decision-only when JavaScript transforms an edit. The adapter rejects UIKit's original edit, records an implementation-private transaction, and applies an incremental `UITextInput` replacement on the next main-queue turn after validating the backing-view generation and base text.

This preserves partial `maxLength` truncation without synchronously replacing the full attributed string or selection. Marked-text composition remains UIKit-owned; an over-limit committed value is corrected through the same deferred transaction path after composition ends. A runtime gate controls the new path.

Stale edits are discarded when the backing text changes, lifecycle and JavaScript-driven updates invalidate queued transactions, and successful commits emit one change update plus the corresponding selection event.

Changelog:
[iOS][Fixed] - Preserve transformed `TextInput` edits without synchronously rewriting text inside UIKit delegate callbacks

Reviewed By: cipolleschi

Differential Revision: D126057002
javache added a commit to javache/react-native that referenced this pull request Oct 20, 2026
…eact#59188)

Summary:

UIKit text change delegate callbacks now remain decision-only when JavaScript transforms an edit. The adapter rejects UIKit's original edit, records an implementation-private transaction, and applies an incremental `UITextInput` replacement on the next main-queue turn after validating the backing-view generation and base text.

This preserves partial `maxLength` truncation without synchronously replacing the full attributed string or selection. Marked-text composition remains UIKit-owned; an over-limit committed value is corrected through the same deferred transaction path after composition ends. A runtime gate controls the new path.

Stale edits are discarded when the backing text changes, lifecycle and JavaScript-driven updates invalidate queued transactions, and successful commits emit one change update plus the corresponding selection event.

Changelog:
[iOS][Fixed] - Preserve transformed `TextInput` edits without synchronously rewriting text inside UIKit delegate callbacks

Reviewed By: cipolleschi

Differential Revision: D126057002
javache added a commit to javache/react-native that referenced this pull request Oct 20, 2026
…eact#59188)

Summary:
Pull Request resolved: react#59188

UIKit text change delegate callbacks now remain decision-only when JavaScript transforms an edit. The adapter rejects UIKit's original edit, records an implementation-private transaction, and applies an incremental `UITextInput` replacement on the next main-queue turn after validating the backing-view generation and base text.

This preserves partial `maxLength` truncation without synchronously replacing the full attributed string or selection. Marked-text composition remains UIKit-owned; an over-limit committed value is corrected through the same deferred transaction path after composition ends. A runtime gate controls the new path.

Stale edits are discarded when the backing text changes, lifecycle and JavaScript-driven updates invalidate queued transactions, and successful commits emit one change update plus the corresponding selection event.

Changelog:
[iOS][Fixed] - Preserve transformed `TextInput` edits without synchronously rewriting text inside UIKit delegate callbacks

Reviewed By: cipolleschi

Differential Revision: D126057002
javache added a commit to javache/react-native that referenced this pull request Oct 20, 2026
…eact#59188)

Summary:
Pull Request resolved: react#59188

UIKit text change delegate callbacks now remain decision-only when JavaScript transforms an edit. The adapter rejects UIKit's original edit, records an implementation-private transaction, and applies an incremental `UITextInput` replacement on the next main-queue turn after validating the backing-view generation and base text.

This preserves partial `maxLength` truncation without synchronously replacing the full attributed string or selection. Marked-text composition remains UIKit-owned; an over-limit committed value is corrected through the same deferred transaction path after composition ends. A runtime gate controls the new path.

Stale edits are discarded when the backing text changes, lifecycle and JavaScript-driven updates invalidate queued transactions, and successful commits emit one change update plus the corresponding selection event.

Changelog:
[iOS][Fixed] - Preserve transformed `TextInput` edits without synchronously rewriting text inside UIKit delegate callbacks

Reviewed By: cipolleschi

Differential Revision: D126057002
…eact#59188)

Summary:
Pull Request resolved: react#59188

UIKit text change delegate callbacks now remain decision-only when JavaScript transforms an edit. The adapter rejects UIKit's original edit, records an implementation-private transaction, and applies an incremental `UITextInput` replacement on the next main-queue turn after validating the backing-view generation and base text.

This preserves partial `maxLength` truncation without synchronously replacing the full attributed string or selection. Marked-text composition remains UIKit-owned; an over-limit committed value is corrected through the same deferred transaction path after composition ends. A runtime gate controls the new path.

Stale edits are discarded when the backing text changes, lifecycle and JavaScript-driven updates invalidate queued transactions, and successful commits emit one change update plus the corresponding selection event.

Changelog:
[iOS][Fixed] - Preserve transformed `TextInput` edits without synchronously rewriting text inside UIKit delegate callbacks

Reviewed By: cipolleschi

Differential Revision: D126057002
@meta-codesync meta-codesync Bot closed this in ac766e6 Oct 20, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @javache in ac766e6

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 20, 2026
@facebook-github-tools

Copy link
Copy Markdown

This pull request has been reverted by 8efebe9.

@javache
javache deleted the export-D126057002 branch October 20, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants