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: Selecting a group may cause selection of duplicate items (#945) #969

Merged
merged 2 commits into from
Apr 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/multiselectMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ export default {

this.$emit('input', newValue, this.id)
} else {
const optionsToAdd = group[this.groupValues].filter(not(this.isOptionDisabled || this.isSelected))
Copy link
Collaborator Author

@akki-jat akki-jat Apr 19, 2019

Choose a reason for hiding this comment

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

The problem here was that not function takes a function as parameter and as the name suggests performs not operation on it's response and we were passing two functions separated by pipe as parameter so it always takes first function - isOptionDisabled (takes second function - isSelected only when first function is null / undefined - which is not the case here)

const optionsToAdd = group[this.groupValues].filter(
option => !(this.isOptionDisabled(option) || this.isSelected(option))
)

this.$emit('select', optionsToAdd, this.id)
this.$emit(
Expand Down