Fix cursor disappear on undo.#122402
Merged
auto-submit[bot] merged 3 commits intoflutter:masterfrom Mar 16, 2023
Merged
Conversation
33895b2 to
a5756c3
Compare
justinmc
reviewed
Mar 13, 2023
Contributor
justinmc
left a comment
There was a problem hiding this comment.
Looks good, just one idea to possibly get rid of _hasPendingChange.
Contributor
There was a problem hiding this comment.
Would it be possible to get rid of _hasPendingChange and use _throttleTimer?.isActive instead?
Contributor
Author
There was a problem hiding this comment.
That's a great idea. I updated the PR and it works nicely, thanks!
a5756c3 to
1d5e3e3
Compare
justinmc
approved these changes
Mar 15, 2023
Contributor
justinmc
left a comment
There was a problem hiding this comment.
LGTM 👍 Thank you for fixing this!
a68fbb0 to
87e43de
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 16, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 16, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 16, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 16, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 17, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 10, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 10, 2023
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.
Description
This PR updates the undo logic to fix two problems:
Steps to Reproduce
Code sample (which creates a TextField with the non empty text, "Flutter").
Problem 1: Tap ‘3’ and undo before the throttling delay ends (500ms).
Before this fix: the text is ‘Flutter’ and the cursor disappeared. Tapping a new key will insert it before ‘Flutter’.
After this fix: the text should be ‘Flutter’ and the cursor at the end.
Problem 2: Tap ‘3’, wait for the throttling delay, tap ‘3’ again and undo before the throttling delay ends.
Before this fix: the text value is ‘Flutter’ (penultimate state).
After this fix: the text value is ‘Flutter3’.
Related Issue
Fixes #120194
Tests
Adds 2 tests.