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] - It's not possible to change Autocomplete selection if labels and keys are the same #2955

Open
wolkyura opened this issue May 5, 2024 · 1 comment · May be fixed by #2969
Open

[BUG] - It's not possible to change Autocomplete selection if labels and keys are the same #2955

wolkyura opened this issue May 5, 2024 · 1 comment · May be fixed by #2969
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@wolkyura
Copy link

wolkyura commented May 5, 2024

NextUI Version

2.3.6

Describe the bug

It's not possible to select a different item if the items' labels and keys are the same, for example:

<Autocomplete selectedKey={value} onSelectionChange={setValue}>
  <AutocompleteItem key="cat" value="cat">
    cat
  </AutocompleteItem>
  <AutocompleteItem key="dog" value="dog">
    dog
  </AutocompleteItem>
</Autocomplete>

Your Example Website or App

https://codesandbox.io/p/devbox/interesting-cohen-k27z8w

Steps to Reproduce the Bug or Issue

  1. Go to https://k27z8w-3000.csb.app/
  2. Open the first autocomplete
  3. Select "Dog" option
  4. See that the selected value is changed
  5. Open the second autocomplete
  6. Select "dog" option
  7. See that the selected value is not change

Expected behavior

I'd say labels and keys can be the same and it shouldn't affect the autocomplete behavior

Screenshots or Videos

Screen.Recording.2024-05-05.at.7.04.16.PM.mov

Operating System Version

macOS

Browser

Chrome

@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels May 6, 2024
@chirokas chirokas linked a pull request May 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants