jeremydavidson / react-search-panel

MIT License
1 stars 2 forks source link

Bug: Search panel displays all possibles choices, regardless of input text #31

Open curtis-nichols opened 3 years ago

curtis-nichols commented 3 years ago

I believe this is a bug, as it is different from the demo functionality. You can reproduce it by looking at the react-search-panel Storybook .

jeremydavidson commented 3 years ago

The intention is for the consumer to handle the component onChange event and decide how choices should change based on that. See the example implementation where it calls an API when input text changes then sets choices based on the response: https://github.com/jeremydavidson/react-search-panel/blob/main/example/src/App.tsx.

You may want to do something else, like filter a static list of choices. You may also want to require a minimum number of characters before you do anything based on input changes. So, I thought it best to leave that implementation to the consumer.

@curtis-nichols, what is your particular use case?