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

feat:typeahead Don't select any fields until the first up/down arrow keypress #3965

Closed
maurizi opened this issue Mar 9, 2018 · 0 comments
Closed

Comments

@maurizi
Copy link
Contributor

maurizi commented Mar 9, 2018

We've been having problems with the typeahead behavior introduced in #2839 in conjunction with setting minLength to 0.

Due to the above feature, when a typeahead has a minLength of 0, when keyboard / screen reader users Tab from field to field, as they go through the typeahead field they unintentionally select the first item from the list.

Disabling the select on Tab feature as outlined in #3842 would be one way to fix the issue, but we do like the idea behind the feature, and we think that a fairly minimal change in behavior could allow keeping the feature around while also improving the experience for keyboard users.

Our proposal is to change the initial state when the typeahead dropdown menu is first shown, so that rather than the first item being active and selected on Enter/Tab, no items are active until the first up/down arrow keypress, and so enter/tab would not select anything until then.

Would this be a welcome change? Would this be a desired default behavior or an optional one?

We're very interested in this feature (or something similar) and/or #3842, and would be happy to implement the feature ourselves, especially if it would be welcomed by the project maintainers.

maurizi added a commit to azavea/ngx-bootstrap that referenced this issue Mar 13, 2018
Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alernating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965
maurizi added a commit to azavea/ngx-bootstrap that referenced this issue Mar 13, 2018
Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965
maurizi added a commit to azavea/ngx-bootstrap that referenced this issue Mar 13, 2018
Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965
maurizi added a commit to azavea/ngx-bootstrap that referenced this issue Mar 13, 2018
Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965
maurizi added a commit to azavea/ngx-bootstrap that referenced this issue Mar 13, 2018
Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965
maurizi added a commit to azavea/ngx-bootstrap that referenced this issue Mar 26, 2018
Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965
valorkin pushed a commit that referenced this issue Feb 8, 2019
… list (#4631)

* fix(typeahead): was restored lost commit

* fix(typeahead): change property typeaheadSelectFirstItem name

* fix(typeahead): change property typeaheadSelectFirstItem name

* feat(typeahead): rework logic of typeaheadSelectFirstItem property

* fix(typeahead): fix event name

Fixes #3965
@ghost ghost assigned Domainv Mar 25, 2019
Domainv pushed a commit that referenced this issue Apr 2, 2019
…3983)

* docs(typeahead) Add min length example to docs

* chore(typeahead) Fix typo

* chore(typeahead) incorrect comment

* feat(typeahead) stop selecting first result when displaying matches

Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes #3965

* fix(typeahead): clean up

* fix(typeahead): fix unit tests
leo6104 pushed a commit to leo6104/ngx-bootstrap that referenced this issue Oct 10, 2019
… list (valor-software#4631)

* fix(typeahead): was restored lost commit

* fix(typeahead): change property typeaheadSelectFirstItem name

* fix(typeahead): change property typeaheadSelectFirstItem name

* feat(typeahead): rework logic of typeaheadSelectFirstItem property

* fix(typeahead): fix event name

Fixes valor-software#3965
leo6104 pushed a commit to leo6104/ngx-bootstrap that referenced this issue Oct 10, 2019
…alor-software#3983)

* docs(typeahead) Add min length example to docs

* chore(typeahead) Fix typo

* chore(typeahead) incorrect comment

* feat(typeahead) stop selecting first result when displaying matches

Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965

* fix(typeahead): clean up

* fix(typeahead): fix unit tests
IraErshova pushed a commit to IraErshova/ngx-bootstrap that referenced this issue Jan 20, 2020
… list (valor-software#4631)

* fix(typeahead): was restored lost commit

* fix(typeahead): change property typeaheadSelectFirstItem name

* fix(typeahead): change property typeaheadSelectFirstItem name

* feat(typeahead): rework logic of typeaheadSelectFirstItem property

* fix(typeahead): fix event name

Fixes valor-software#3965
IraErshova pushed a commit to IraErshova/ngx-bootstrap that referenced this issue Jan 20, 2020
…alor-software#3983)

* docs(typeahead) Add min length example to docs

* chore(typeahead) Fix typo

* chore(typeahead) incorrect comment

* feat(typeahead) stop selecting first result when displaying matches

Switches from always setting the first result to be the active one, and
instead initially displays the result list with no active item.
After the pressing down/up keys the first/last item will be selected.

Also cleans up the keyboard interaction when alternating between
navigating between matches with arrow keys and typing additional
characters, by keeping the previous match selected if it continues to be
a match with the new results, instead of the previous behavior of
resetting to the first item selected.

Closes valor-software#3965

* fix(typeahead): clean up

* fix(typeahead): fix unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants