react-select-plus icon indicating copy to clipboard operation
react-select-plus copied to clipboard

delete key is not affecting input text

Open esstengolebanidze opened this issue 7 years ago • 0 comments

Hello,

I had an issue with dropdown when searching. Delete key was not affecting input text. I looked into code (Select.js; handleKeyDown function line: 475). There is switch statement to handle some keys including backspace and delete, I assume they should have similar logic but codewise there is a slight difference (maybe unintended).

For backspace - first happens check on (!this.state.inputValue && this.props.backspaceRemoves) and if it's true only then preventDefault and popValue are called (Line: 486) For delete - no matter what preventDefault is called and then there's check on (!this.state.inputValue && this.props.deleteRemoves). (Line: 560). I assume preventDefault should be inside of if statement.

To reproduce: set 'searchable' to true; enter search text; try to delete symbols using delete key.

esstengolebanidze avatar Sep 26 '18 08:09 esstengolebanidze