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

fix(combobox): correct behavior of selection onChange with filtered items #16835

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

tay1orjones
Copy link
Member

Closes #16630
Closes #16829

This corrects selection and onChange behavior when the listbox items are filtered and one is selected.

Changelog

New

  • Adds cognateItems to help test the partial search functionality in Combobox
  • Adds tests to cover the defects described in the root issues

Changed

  • Update allowCustomInput story to log onChange actions to the actions pane
  • Update ComboBox to call filterItems() instead of using the base items

Testing / Reviewing

  • Go to the Combobox / Allow Custom Input story
  • input apple
  • click to select pineapple - selection should be correct, onChange in the actions pane should fire once with the proper value

@riddhybansal
Copy link
Contributor

Am not sure but I could not see the deploy preview for this PR 😮

@alisonjoseph
Copy link
Member

@riddhybansal not sure why the deploy preview didn't post a github comment, but you can click the link directly from the checks on the PR.
https://deploy-preview-16802--v11-carbon-react.netlify.app/
image

Copy link
Member

@alisonjoseph alisonjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected for me, and new tests look good 👍

Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected! LGTM

@guidari guidari added this pull request to the merge queue Jun 21, 2024
Merged via the queue into carbon-design-system:main with commit 22dea80 Jun 21, 2024
42 checks passed
tay1orjones added a commit to tay1orjones/carbon that referenced this pull request Jun 21, 2024
…tems (carbon-design-system#16835)

* fix(combobox): onChange returns the proper item with shouldFilterItem

* WIP

* fix(combobox): use filterItems for items

* fix(combobox): correct selection when filtered items
@tay1orjones tay1orjones mentioned this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants