react-typeahead icon indicating copy to clipboard operation
react-typeahead copied to clipboard

Option to show list when input is focused?

Open poeticninja opened this issue 10 years ago • 4 comments

Thanks for the great work on this project! I am wanting to show the list of options when a user focuses/selects the input field. This was not obvious on how to achieve this. Am I missing something or is this a feature that is not available?

Thanks!

poeticninja avatar Aug 05 '15 15:08 poeticninja

I have the same question.

I have tried to provide a custom filterOption that returns true (= shows all options) when the user enters an empty space :

filterOption (inputValue, option) {
  if (inputValue === ' ') return true
  return option.includes(inputValue)
}

The filterOption works with all other values but it seems that an empty space is swallowed and ignored.

barbalex avatar Nov 10 '15 13:11 barbalex

+1

vagnervjs avatar Dec 01 '15 21:12 vagnervjs

This behavior can be achieved with props.showListWhenEmpty in combination with filtering out all the options when the input is not focused.

A helper for this would be nice - show list when empty doesn't seem as useful as show list when focused.

rrcobb avatar Apr 04 '16 17:04 rrcobb

Any updates on this?

@rrcobb could you please provide sample code?

miraage avatar Jul 19 '16 09:07 miraage