react-component / react-component/select
Typing `Backspace` on `input` inside the custom component `dropdownRender` remove last selected value
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 938
- Forks
- 482
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 2
Description
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
- Select multiple values.
- Type some text on input in the dropdown.
- Type
Backspaceto 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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue from the linked CodeSandbox in App.tsx, using a multiple Select with a custom dropdownRender input. Trace how Backspace events from that nested input reach Select, then verify that deleting its text no longer removes the last selected value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100