-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: #18062 MultiSelect is removing previously selected values if sel… #18107
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
base: master
Are you sure you want to change the base?
Conversation
…ect all is checked after search
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Thank you for your contribution! We will review your PR shortly. Please make sure to manually link it to an issue for proper tracking. |
Thank you for your contribution! We will review your PR shortly. Please make sure to manually link it to an issue for proper tracking. |
const optionValues = [...selectedDisabledOptions, ...visibleOptions].map((option) => this.getOptionValue(option)); | ||
const selectedOptionsBeforeSearch = this.filter ? this.getAllVisibleAndNonVisibleOptions().filter((option) => this.isSelected(option) && this.isValidOption(option)) : []; | ||
|
||
const optionValues = [...(!this.allSelected() ? selectedOptionsBeforeSearch : []), ...selectedDisabledOptions, ...visibleOptions].map((option) => this.getOptionValue(option)); | ||
const value = [...new Set(optionValues)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For efficiency why not remove the conditional !this.allSelected() from const optionValues and update the conditional in const selectedOptionsBeforeSearch to (this.filter && !this.allSelected())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already refactored the code right after committing it. Thanks a lot for the review.
fixes #18062