这是indexloc提供的服务,不要输入任何密码
Skip to content

Make selected item get focus when dropdown is opened #43722

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

Merged
merged 4 commits into from
Nov 8, 2019

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog 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.

@fluttergithubbot fluttergithubbot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) d: examples Sample code and demos engine flutter/engine repository. See also e: labels. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. work in progress; do not review 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 removed a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) d: examples Sample code and demos engine flutter/engine repository. See also e: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Oct 29, 2019
@gspencergoog gspencergoog force-pushed the dropdown_select branch 7 times, most recently from 156232c to f38d742 Compare November 1, 2019 16:58
@gspencergoog gspencergoog marked this pull request as ready for review November 1, 2019 16:58
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog force-pushed the dropdown_select branch 2 times, most recently from 361236a to b7a43d7 Compare November 2, 2019 02:36
@gspencergoog gspencergoog merged commit 19778f9 into flutter:master Nov 8, 2019
@gspencergoog gspencergoog deleted the dropdown_select branch November 13, 2019 23:20
@Piinks Piinks mentioned this pull request Apr 9, 2020
9 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants