select icon indicating copy to clipboard operation
select copied to clipboard

Typing `Backspace` on `input` inside the custom component `dropdownRender` remove last selected value

Open caocuong2404 opened this issue 3 years ago • 0 comments

Date Seen (21 Sep, 2022)

Versions

  • Operating System and version: MacOS 12.6
  • Browser and Version: Brave based on Chromium: 105.0.5195.102
  • Lib: rc-select@^14.1.2

Bug Description I customized the dropdownRender component. Inside this component is the input box to filter value. When I remove the text on input by backspace. The selected value is removing the last item. I inspected the library rc-select, I think the root cause from the event listener listen to any input element inside Select component.

Steps to Reproduce

  1. Select multiple values.
  2. Type some text on input in the dropdown.
  3. Type Backspace to remove text on input.

Actual Behavior The last item on the selected value was removed on Select

Expected Behavior Shouldn't affect the selected value.

Codesandbox: https://codesandbox.io/s/rc-select-multiple-search-inside-dropdown-6ibpj6?file=/App.tsx

caocuong2404 avatar Sep 21 '22 10:09 caocuong2404