-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Focus text field after clicking SelectAll
icon button
#12408
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
base: main
Are you sure you want to change the base?
Conversation
In the example, when user click `SelectAll` icon button, the `controller.selection` is updated, but the focus is moved to the `SelectAll` icon button. Visually, user doesn't see the selection. If we give the focus back to the text field, user will see the selection visually.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
It looks good to me, but I'm going to complete the website build before having a DRE approve. Thanks for this PR!
/gbcrun |
@xuanswe, it looks like you didn't update the code excerpts in your PR. Can you do so? As explained in the README file, when you update code on the site, you must run the refresh code excerpts tool: "To resolve this error and update the Markdown snippets to match, And then update the PR. |
Thanks for reviewing the PR. Currently I don't have a linux environment to run the bash file. Instead, is it ok if I manually update the file https://github.com/flutter/website/blob/main/examples/ui/actions_and_shortcuts/lib/copyable_text.dart? Otherwise, it would be nice if you could help me complete the missing step. |
/gcbrun |
Visit the preview URL for this PR (updated for commit 2422cc7): |
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. @khanhnwin, the code passes the build, but does this look ok to you?
Description of what this PR is changing or adding, and why:
In the example, when user click
SelectAll
icon button, thecontroller.selection
is updated, but the focus is moved to theSelectAll
icon button. Because of that, user doesn't see the selection visually. If the text field is focused again, user will see the selection.Issues fixed by this PR (if any):
PRs or commits this PR depends on (if any):
Presubmit checklist
of 80 characters or fewer.