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

Bug: Entered search data persists in vue-select with 'required' and 'multiple' enabled #1832

Open
ay232 opened this issue May 3, 2024 · 0 comments
Labels

Comments

@ay232
Copy link

ay232 commented May 3, 2024

  • Vue Version: 2.6.12
  • Vue Select Version: 3.11.2

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 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

  1. Include a vue-select component in the form with properties multiple=true and required=true.
  2. Open the dropdown and type something into the search box to filter options.
  3. Close the dropdown without selecting any options.
  4. Observe that the entered search data persists in the vue-select input field.
  5. 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.

Screenshots
image

@ay232 ay232 added the bug label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant