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

Options selected not reflective of values when using type ahead #2276

Open
decherneyge opened this issue Aug 22, 2023 · 0 comments
Open

Options selected not reflective of values when using type ahead #2276

decherneyge opened this issue Aug 22, 2023 · 0 comments
Assignees

Comments

@decherneyge
Copy link

Describe the bug
When using the typeahead functionality and if there are items with the same value for bindLabel, the displayed selected state of the options in the menu panel changes depending on the point in the workflow.

Reproducbile example
Example which reproduces described behaviour

To Reproduce
Steps to reproduce the behavior (if example is not provided):

  1. Go to example stackblitz
  2. Search for 'Kar'
  3. Notice there are two options with the same name
  4. Select the first option
  5. Search for 'Kar'
  6. Notice the first item is checked as expected and the second item is not checked also as expected
  7. select the second option
  8. Notice the values show both items. The labels are the same but thats ok the point is there are two items and the json blob shows two distinct items.
  9. Click into the select box to open the dropdown again and notice both options are selected
  10. Search for 'Kar'
  11. Notice only 1 item is selected
  12. Click out of the control to close the options menu
  13. Click into the control to reopen the options menu
  14. Notice only 1 item is selected

Expected behavior
The displayed selected state of the options in the menu panel reflects what is selected.

Screenshots
If applicable, add screenshots to help explain your problem.
Step 2: Searching
image

Step 9: Both selected
image

Step 11: Typeahead results
image

Step 14: Only 1 option selected after searching again
image

Desktop (please complete the following information):

  • OS: All
  • Browser All
  • Version All

Smartphone (please complete the following information):

  • Device: All
  • OS: All
  • Browser: All
  • Version: All

Additional context
I believe this could be solved by using a compareWith function however it feels like a common enough scenario that I thought I would at least the raise the question on if it should be handled within the component.

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