Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Delete character (0x7F) propagates to inputValue when deleting a selected item #1358

Open
petercpwong opened this issue Feb 6, 2022 · 2 comments

Comments

@petercpwong
Copy link

petercpwong commented Feb 6, 2022

  • downshift version: 6.1.7
  • node version: 14.18.1
  • npm (or yarn) version: yarn 1.22.15

Description of the bug:

When the useMultipleSelection hook uses a controlled selectedItems prop, the delete character (0x7F) gets outputted to the text input after deleting the last selected item.

Code:

Here's a code sandbox with the sample code found in the docs but selectedItems is used instead of initialSelectedItems:

https://codesandbox.io/s/downshift-bug-controlled-multi-selection-dc1u7?file=/src/DropdownMultipleCombobox.js

Steps to reproduce:

  1. Click on one of the selected items (apple or orange)
  2. Press DELETE
  3. Press DELETE
  4. Delete character (0x7F) should appear inside the text input
Screencast.2022-02-07.04.31.00.mp4
@silviuaavram silviuaavram added bug and removed bug labels Feb 7, 2022
@silviuaavram
Copy link
Collaborator

Thanks for the posting the issue!

On MacOS I could not repro the issue. There is nothing in my input after deleting the items. Could it be related to os or hardware specific differences?

@petercpwong
Copy link
Author

You're right. I forgot to add that I'm using Ubuntu 20.04.

I also just did a test on macOS and can confirm it works as expected. I've yet to test it on Windows so it may just be a Linux-specific problem for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants