Skip to content
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

Make selected item get focus when dropdown is opened #43722

Merged
merged 4 commits into from Nov 8, 2019

Conversation

@gspencergoog
Copy link
Contributor

gspencergoog commented Oct 29, 2019

Description

As it stands, dropdowns currently do not focus the item that is selected, so if you select something on a dropdown, and then close it, and re-open it, then the new item is not auto-focused. This PR changes that so that selected value is focused by default when the dropdown is re-opened.

Tests

  • Added tests for making sure that the right element is focused when a dropdown opens, and that the dropdown itself is focused when the dropdown is closed.

Breaking Change

  • Yes, this is a breaking change, because it changes the focus behavior of dropdowns. Only dropdowns that expect to control focus themselves are affected.
@googlebot googlebot added the cla: no label Oct 29, 2019
@gspencergoog gspencergoog force-pushed the gspencergoog:dropdown_select branch from b32e006 to 2d24821 Oct 29, 2019
@googlebot googlebot added cla: yes and removed cla: no labels Oct 29, 2019
@flutter flutter deleted a comment from googlebot Oct 29, 2019
@flutter flutter deleted a comment from googlebot Oct 29, 2019
@gspencergoog gspencergoog force-pushed the gspencergoog:dropdown_select branch 7 times, most recently from 156232c to f38d742 Oct 29, 2019
@gspencergoog gspencergoog marked this pull request as ready for review Nov 1, 2019
@gspencergoog gspencergoog requested a review from HansMuller Nov 1, 2019
Copy link
Contributor

HansMuller left a comment

LGTM

@gspencergoog gspencergoog force-pushed the gspencergoog:dropdown_select branch 2 times, most recently from 361236a to b7a43d7 Nov 2, 2019
…he focused item when focus moves.
@gspencergoog gspencergoog force-pushed the gspencergoog:dropdown_select branch from b7a43d7 to 4eea5be Nov 6, 2019
@gspencergoog gspencergoog merged commit 19778f9 into flutter:master Nov 8, 2019
63 checks passed
63 checks passed
WIP Ready for review
Details
analyze-linux Task Summary
Details
analyze-linux
Details
build_tests-linux Task Summary
Details
build_tests-linux
Details
cla/google All necessary CLAs are signed
customer_testing-linux Task Summary
Details
customer_testing-linux
Details
customer_testing-macos Task Summary
Details
customer_testing-macos
Details
customer_testing-windows Task Summary
Details
customer_testing-windows
Details
deploy_gallery-linux Task Summary
Details
deploy_gallery-linux
Details
deploy_gallery-macos Task Summary
Details
deploy_gallery-macos
Details
docs-linux Task Summary
Details
docs-linux
Details
firebase_test_lab_tests-linux Task Summary
Details
firebase_test_lab_tests-linux
Details
flutter-build
Details
framework_tests-libraries-linux Task Summary
Details
framework_tests-libraries-linux
Details
framework_tests-libraries-macos Task Summary
Details
framework_tests-libraries-macos
Details
framework_tests-libraries-windows Task Summary
Details
framework_tests-libraries-windows
Details
framework_tests-misc-linux Task Summary
Details
framework_tests-misc-linux
Details
framework_tests-misc-macos Task Summary
Details
framework_tests-misc-macos
Details
framework_tests-misc-windows Task Summary
Details
framework_tests-misc-windows
Details
framework_tests-widgets-linux Task Summary
Details
framework_tests-widgets-linux
Details
framework_tests-widgets-macos Task Summary
Details
framework_tests-widgets-macos
Details
framework_tests-widgets-windows Task Summary
Details
framework_tests-widgets-windows
Details
hostonly_devicelab_tests-0-linux Task Summary
Details
hostonly_devicelab_tests-0-linux
Details
hostonly_devicelab_tests-1-linux Task Summary
Details
hostonly_devicelab_tests-1-linux
Details
hostonly_devicelab_tests-2-linux Task Summary
Details
hostonly_devicelab_tests-2-linux
Details
hostonly_devicelab_tests-3_last-linux Task Summary
Details
hostonly_devicelab_tests-3_last-linux
Details
web_tests-0-linux Task Summary
Details
web_tests-0-linux
Details
web_tests-1-linux Task Summary
Details
web_tests-1-linux
Details
web_tests-2-linux Task Summary
Details
web_tests-2-linux
Details
web_tests-3-linux Task Summary
Details
web_tests-3-linux
Details
web_tests-4-linux Task Summary
Details
web_tests-4-linux
Details
web_tests-5-linux Task Summary
Details
web_tests-5-linux
Details
web_tests-6-linux Task Summary
Details
web_tests-6-linux
Details
web_tests-7_last-linux Task Summary
Details
web_tests-7_last-linux
Details
@gspencergoog gspencergoog deleted the gspencergoog:dropdown_select branch Nov 13, 2019
sahandevs added a commit to sahandevs/flutter that referenced this pull request Nov 15, 2019
As it stands, dropdowns currently do not focus the item that is selected, so if you select something on a dropdown, and then close it, and re-open it, then the new item is not auto-focused. This PR changes that so that selected value is focused by default when the dropdown is re-opened.
sahandevs added a commit to sahandevs/flutter that referenced this pull request Nov 15, 2019
As it stands, dropdowns currently do not focus the item that is selected, so if you select something on a dropdown, and then close it, and re-open it, then the new item is not auto-focused. This PR changes that so that selected value is focused by default when the dropdown is re-opened.
sahandevs added a commit to sahandevs/flutter that referenced this pull request Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.