angular / angular/components

Autocomplete: when using the keyboard to navigate the options, the currently focused item should be the 'selected' option

Abierto
#4,951 17 comentarios 13 reacciones 0 asignados Ver en GitHub
area: material/autocomplete feature P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Bug, feature request, or proposal:
Feature request

#### What is the expected behavior?
When using the keyboard to navigate through the options, as the focus changes from one option to another, the selected option should be the currently focused option, thus following the "selection follow focus" principle as stated in the Material docs [here](https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focus).

If the desire is to leave the current behavior then at least provide an option to turn this behavior on.

#### What is the current behavior?
Using the keyboard to navigate the options does not automatically update the 'selected' option.

#### What is the use-case or motivation for changing an existing behavior?
Many users expect to be able to select an option by simply navigating the options without being required to press a particular key to indicate their selection. By simply leaving the current control after having navigating to a particular option, they assume that they have selected the option as well. The main example I have for this is using the TAB key. I often navigate options using the arrow key and then press the TAB key after having 'selected' my option using the arrow keys. The current behavior is such that you are required to 'select' the option using the ENTER key, otherwise the value is not set when you TAB away from the control.

Google's own search engine follows this principle. As you type in your search, Google begins searching for the phrase and provides several autocomplete phrases for you. If you navigate the provided phrases, the search results update based on the currently focused phrase without having pressed ENTER or another key.

#### Is there anything else we should know?
See [this](https://github.com/angular/material2/pull/4401) pull request for the initial discussion.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza revisando el pull request enlazado #4401 y el debate existente de 17 comentarios para comprender las decisiones de comportamiento que siguen sin resolverse. A continuación, sigue la implementación de Angular Material autocomplete desde su punto de entrada del componente y determina si completion debería hacer que el foco siga a la selección o exponer una opción para ese comportamiento. Se considerará terminado cuando el comportamiento elegido esté implementado y verificado para la navegación con las teclas de flecha seguida de TAB, y se haya abordado el flujo existente de ENTER.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.