When a user changes a multiselect element, there is a function that runs to control the visibility of an error message:
getVisibility(multiselect) {
if ((multiselect.selectedCategories.length < 1 && !multiselect.allSelected) && this.submitted) {
return 'visible'
} else {
return 'hidden'
}
}
However, in this particular block of code:
if ((multiselect.selectedCategories.length < 1 && !multiselect.allSelected) && this.submitted)
The situation arises where multiselect.allSelected is false, but !multiselect.allSelected also evaluates to false.
Here are the images depicting the issue:
This leads to the question: Why does adding the not operator (!) not change the boolean value?