Describe the bug
When using vue-select with both required and multiple properties enabled, the search data entered in the select dropdown persists after closing the dropdown. This allows the form to be submitted even if no options are selected, as long as there is some search input remaining.
Reproduction LinkCodePen
You have to change simple v-select to multiple by this code:
<v-select :options="books" multiple label="title"></v-select>
Steps To Reproduce
Include a vue-select component in the form with properties multiple=true and required=true.
Open the dropdown and type something into the search box to filter options.
Close the dropdown without selecting any options.
Observe that the entered search data persists in the vue-select input field.
Attempt to submit the form. The form submits despite no options being chosen.
Expected behavior
The expected behavior is that upon closing the dropdown, any unselected search data should be cleared, especially when no options are selected. The form should only submit when at least one option is selected, respecting the required constraint.
Screenshots
Attached are screenshots demonstrating the behavior (please add your screenshots here).
Additional context
This behavior can lead to confusion and potential data integrity issues, as the form believes input is present when actually no options have been selected.
Describe the bug When using vue-select with both
required
andmultiple
properties enabled, the search data entered in the select dropdown persists after closing the dropdown. This allows the form to be submitted even if no options are selected, as long as there is some search input remaining.Reproduction Link CodePen You have to change simple v-select to multiple by this code:
<v-select :options="books" multiple label="title"></v-select>
Steps To Reproduce
multiple=true
andrequired=true
.Expected behavior The expected behavior is that upon closing the dropdown, any unselected search data should be cleared, especially when no options are selected. The form should only submit when at least one option is selected, respecting the
required
constraint.Screenshots Attached are screenshots demonstrating the behavior (please add your screenshots here).
Additional context This behavior can lead to confusion and potential data integrity issues, as the form believes input is present when actually no options have been selected.
Screenshots