Skip to content

Add option for not selecting first list item by default, unselect with arrow keys#54

Open
pjsier wants to merge 1 commit intobevacqua:masterfrom
pjsier:select-by-default-option
Open

Add option for not selecting first list item by default, unselect with arrow keys#54
pjsier wants to merge 1 commit intobevacqua:masterfrom
pjsier:select-by-default-option

Conversation

@pjsier
Copy link

@pjsier pjsier commented Mar 11, 2017

  • Adds selectByDefault option that defaults to true, but if set to false it won't select the first item in a result list automatically.
  • Allows users to submit input with the enter key that is not a list item even if results are displayed.
  • Setting it to false also allows users to unselect items in a list by moving outside the bounds of a result list with the arrow keys.

The use case for this came from having Horsey in a search field where I wanted people to be able to have autocomplete as a shortcut, but also be able to submit more general queries and get redirected to a page with results. For the example this would be just pressing enter to search for all results containing "apple" rather than having to pick one of the displayed options with "apple" in it.

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.

1 participant