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(multi-select): Update selected state when pill is removed #3076

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

NicholasBoll
Copy link
Member

@NicholasBoll NicholasBoll commented Dec 17, 2024

Summary

Update the model.selected.items when an item is unselected via the pills.

Fixes: #3075

Release Category

Components


Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)

@NicholasBoll NicholasBoll added the ready for review Code is ready for review label Dec 17, 2024
@@ -66,19 +66,12 @@ export const useMultiSelectModel = createModelHook({
orientation: 'horizontal',
onRemove({id}) {
model.events.select({id});
setSelectedItems(cachedSelected.filter(item => item.id !== id));
Copy link
Member Author

Choose a reason for hiding this comment

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

Updates the selected items when the pill is removed. Without this, the pill that was removed will be temporarily added again while the menu is open and will disappear for good after the menu is closed again.

Copy link

cypress bot commented Dec 17, 2024

Workday/canvas-kit    Run #8136

Run Properties:  status check passed Passed #8136  •  git commit c93eda81d3 ℹ️: Merge 8943a2bcad457ad06f630f184b50dd7819969101 into 49c3b3647b21bb421ae162eaf7c4...
Project Workday/canvas-kit
Branch Review fix/multiselect-pill-remove
Run status status check passed Passed #8136
Run duration 02m 47s
Commit git commit c93eda81d3 ℹ️: Merge 8943a2bcad457ad06f630f184b50dd7819969101 into 49c3b3647b21bb421ae162eaf7c4...
Committer Nicholas Boll
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 923
View all changes introduced in this branch ↗︎
UI Coverage  21.23%
  Untested elements 1523  
  Tested elements 408  
Accessibility  99.14%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 162  

@NicholasBoll NicholasBoll added automerge and removed ready for review Code is ready for review labels Dec 17, 2024
@alanbsmith alanbsmith merged commit 75615f0 into Workday:master Dec 17, 2024
25 of 26 checks passed
@NicholasBoll NicholasBoll deleted the fix/multiselect-pill-remove branch December 17, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CKR 12 Preview Multiselect - Pills get out of sync with popper list
2 participants