-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Pasting collapses the selection and puts it after the pasted content #98679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e8653bc to
9b584da
Compare
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides the failing linux_web_tests_0. Looks like it's failing when trying to select the text.
| selection: TextSelection.collapsed(offset: lastSelectionIndex), | ||
| ); | ||
|
|
||
| _replaceText(ReplaceTextIntent(collapsedTextEditingValue, data.text!, selection, cause)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the first arg of the ReplaceTextIntent constructor should be the current TextEditingValue iirc. I feel it would easier to understand if we just call userUpdateTextEditingValue here with the updated text editing value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, that feels more in the spirit of this stuff. Will do.
…lutter#98679) Desktop selection behavior improvement.
Previously, Flutter kept pasted content selected:
But native platforms collapse the selection like this:
This PR makes Flutter match this native behavior.
Fixes #98677