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

Feature Request: down/up arrow keys activate select #2990

Closed
paullryan opened this issue Feb 8, 2017 · 4 comments · Fixed by #3313
Closed

Feature Request: down/up arrow keys activate select #2990

paullryan opened this issue Feb 8, 2017 · 4 comments · Fixed by #3313
Assignees
Labels
Accessibility This issue is related to accessibility (a11y) feature This issue represents a new feature or feature request rather than a bug or bug fix

Comments

@paullryan
Copy link

Bug, feature request, or proposal:

Use up and down arrow keys to activate select menus and remove return as an activator.

What is the expected behavior?

Standard html select menus are activated on down/up arrow keys and click instead of the return key. This allows return to still submit while making access to the select menu available without a mouse.

Behavior example https://plnkr.co/edit/MoygfDy6qyEyF96Sa0v4?p=preview

What is the current behavior?

up and down do nothing while hitting enter activates the select menu.

What is the use-case or motivation for changing an existing behavior?

accessibility in line with standard html features

Which versions of Angular, Material, OS, browsers are affected?

material2 < 2.0.0-beta.1

@paullryan
Copy link
Author

Stated ARIA interaction spec for listbox menus (from https://www.w3.org/TR/wai-aria-practices/#Listbox):

Keyboard Interaction

For a vertically oriented listbox:

  • When a single-select listbox receives focus:
  • If none of the options are selected before the listbox receives focus, the first option receives focus. Optionally, the first option may be automatically selected.
  • If an option is selected before the listbox receives focus, focus is set on the selected option.
  • When a multi-select listbox receives focus:
  • If none of the options are selected before the listbox receives focus, focus is set on the first option and there is no automatic change in the selection state.
  • If one or more options are selected before the listbox receives focus, focus is set on the first option in the list that is selected.
  • Down Arrow: Moves focus to the next option. Optionally, in a single-select listbox, selection may also move with focus.
  • Up Arrow: Moves focus to the previous option. Optionally, in a single-select listbox, selection may also move with focus.
  • Home (Optional): Moves focus to first option. Optionally, in a single-select listbox, selection may also move with focus. Supporting this key is strongly recommended for lists with more than five options.
  • End (Optional): Moves focus to last option. Optionally, in a single-select listbox, selection may also move with focus. Supporting this key is strongly recommended for lists with more than five options.
  • Type-ahead is recommended for all listboxes, especially those with more than seven options:
  • Type a character: focus moves to the next item with a name that starts with the typed character.
  • Type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed.
  • Multiple Selection: Authors may implement either of two interaction models to support multiple selection: a recommended model that does not require the user to hold a modifier key, such as Shift or Control, while navigating the list or an alternative model that does require modifier keys to be held while navigating in order to avoid losing selection states.
    • Recommended selection model -- holding modifier keys is not necessary:
      • Space: changes the selection state of the focused option .
      • Shift + Down Arrow (Optional): Moves focus to and toggles the selected state of the next option.
      • Shift + Up Arrow (Optional): Moves focus to and toggles the selected state of the previous option.
      • Shift + Space (Optional): Selects contiguous items from the most recently selected item to the focused item.
      • Control + Shift + Home (Optional): Selects the focused option and all options up to the first option.
      • Control + Shift + End (Optional): Selects the focused option and all options down to the last option.
      • Control + A (Optional): Selects all options in the list. Optionally, if all options are selected, it may also unselect all options.
    • Alternative selection model -- moving focus without holding a Shift or Control modifier unselects all selected nodes except the focused node:
      • Shift + Down Arrow: Moves focus to and toggles the selection state of the next option.
      • Shift + Up Arrow: Moves focus to and toggles the selection state of the previous option.
      • Control + Down Arrow: Moves focus to the next option without changing its selection state.
      • Control + Up Arrow: Moves focus to the previous option without changing its selection state.
      • Control + Space Changes the selection state of the focused option.
      • Shift + Space (Optional): Selects contiguous items from the most recently selected item to the focused item.
      • Control + Shift + Home (Optional): Selects the focused option and all options up to the first option.
      • Control + Shift + End (Optional): Selects the focused option and all options down to the last option.
      • Control + A (Optional): Selects all options in the list. Optionally, if all options are selected, it may also unselect all options.

@crisbeto crisbeto self-assigned this Feb 8, 2017
@vipdorian
Copy link

+1 for this bug

@kara kara added Accessibility This issue is related to accessibility (a11y) feature This issue represents a new feature or feature request rather than a bug or bug fix labels Feb 9, 2017
@jefersonestevo
Copy link
Contributor

+1

crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 26, 2017
…en closed

* Adds the ability for users to select options by focusing on a closed `md-select` and pressing the up/down arrow keys.
* Fixes a bug that prevents the selection from going to the first item in a `ListKeyManager`, if there were no previously-selected items.
* Adds an extra null check to the `FocusKeyManager` to avoid issues where the focused item is cleared.

Fixes angular#2990.
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 4, 2017
…en closed

* Adds the ability for users to select options by focusing on a closed `md-select` and pressing the up/down arrow keys.
* Fixes a bug that prevents the selection from going to the first item in a `ListKeyManager`, if there were no previously-selected items.
* Adds an extra null check to the `FocusKeyManager` to avoid issues where the focused item is cleared.

Fixes angular#2990.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 5, 2017
…en closed

* Adds the ability for users to select options by focusing on a closed `md-select` and pressing the up/down arrow keys.
* Fixes a bug that prevents the selection from going to the first item in a `ListKeyManager`, if there were no previously-selected items.
* Adds an extra null check to the `FocusKeyManager` to avoid issues where the focused item is cleared.

Fixes angular#2990.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 5, 2017
…en closed

* Adds the ability for users to select options by focusing on a closed `md-select` and pressing the up/down arrow keys.
* Fixes a bug that prevents the selection from going to the first item in a `ListKeyManager`, if there were no previously-selected items.
* Adds an extra null check to the `FocusKeyManager` to avoid issues where the focused item is cleared.

Fixes angular#2990.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 12, 2017
…en closed

* Adds the ability for users to select options by focusing on a closed `md-select` and pressing the up/down arrow keys.
* Fixes a bug that prevents the selection from going to the first item in a `ListKeyManager`, if there were no previously-selected items.
* Adds an extra null check to the `FocusKeyManager` to avoid issues where the focused item is cleared.

Fixes angular#2990.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) feature This issue represents a new feature or feature request rather than a bug or bug fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants