DigitalRiver / react-atlas

Composable React components with CSS Modules.
http://digitalriver.github.io/react-atlas/
MIT License
38 stars 25 forks source link

Dropdown options display should reset with onBlur event #762

Closed Magneticmagnum closed 6 years ago

floydchenchen commented 6 years ago

added new feature along with fixing this issue: when typing, the dropdown can automatically hover on the first option that matches the input (e.g., for states dropdown, typing al will hover on Alabama). So when users hit enter the option on hover will be selected.

floydchenchen commented 6 years ago

new bug: when entering random stuff that does not match any option and hit enter, code breaks problem: did not check if this.state.options is an empty array before calling it in const newValue = this.state.options[this.state.tempIndex].props. fix: add new check to make sure this.state.options is not an empty array