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

Fix for keyboard highlighting of selections #66

Merged
merged 2 commits into from
Apr 16, 2020

Conversation

Birdstown
Copy link
Contributor

@Birdstown Birdstown commented Apr 15, 2020

I'm submitting a...

  • Bug Fix
  • Feature
  • Other (Refactoring, Added tests, Documentation, ...)

Description

Fixes an issue where the keyboard up/down arrow is used to highlight a selection.
At the moment the highlight is bound to the number of suggestions, but the maxResults parameter means that not all suggestions are visible.

As a result it is possible to move the highlight beyond the visible suggestions, which will then result in a non-visible suggestion being selected when the user presses enter/tab to leave the field.

This fix prevents the keyboard up/down arrow from moving beyond the visible suggestions.

Also, adding export for AutoCompleteStyles object to allow creation of object that can be shared between several fields.

Does this PR introduce a breaking change?

  • Yes
  • No

Does this PR affects any existing issues?

  • Yes
  • No

When using keyboard arrow up/down to highlight items where there are
more suggestions than can be displayed by the maxResults parameter,
the highlight disappears but is still selecting an item, allowing
selection of a non-visible suggestion.

This limits keyboard highlighting to the lesser of the number of
suggestions or the value of maxResults.
Added export for AutoCompleteStyles to allow for creation of object that
can be shared where multiple instances of the component need shared
styling.
@jrquick17 jrquick17 merged commit 98c6ddc into jrquick17:master Apr 16, 2020
@jrquick17
Copy link
Owner

Merged and released. Thanks for the help.

@Birdstown Birdstown deleted the highlight-fix branch April 16, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants