Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 600567e

Browse files
authored
Fire TextInputClient.updateEditingState on text changes (iOS) (#3995)
For consistency with Android, when the engine receives a TextInput.setEditingState message from the framework, and the text has changed, we now send a TextInputClient.updateEditingState message back to the framework with the updated state from the engine. The framework currently relies on this behaviour to trigger onChanged events in certain scenarios (e.g., on tapping Paste in the selection controls). Note: it may be more desirable for the framework to trigger the onChanged calls without relying on the return message from the engine, but this change ensures consistent behaviour across iOS and Android until we've evaluated the pros/cons of such an approach.
1 parent e40d4a9 commit 600567e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,12 @@ - (void)setTextInputState:(NSDictionary*)state {
196196
[self.inputDelegate selectionDidChange:self];
197197
}
198198

199-
if (textChanged)
199+
if (textChanged) {
200200
[self.inputDelegate textDidChange:self];
201+
202+
// For consistency with Android behavior, send an update to the framework.
203+
[self updateEditingState];
204+
}
201205
}
202206

203207
#pragma mark - UIResponder Overrides

0 commit comments

Comments
 (0)