Vuetify: [Bug Report] Validation is always true for a v-select or v-autocomplete when the multiple prop is set to true

Created on 28 Apr 2020  路  2Comments  路  Source: vuetifyjs/vuetify

Environment

Vuetify Version: 2.2.20
Vue Version: 2.6.11
Browsers: Chrome 81.0.4044.129
OS: Windows 10

Steps to reproduce

Create a v-form
Insert either a v-select or v-autocomplete with the prop :multiple="true" inside the form.
Validate the form
The form will be valid, even if there is no option selected in the multiple select/autocomplete.

Expected Behavior

The form should not be valid until an option has been selected

Actual Behavior

The form is valid

Reproduction Link

https://codepen.io/matt-h/pen/PoPjEgX

Other comments

I have tested on 2.2.25 and the issue still persists.
Tested with both v-select and v-autocomplete
Used :multiple="true" and multiple

layer 8 issue

Most helpful comment

!![] resolves to true

:rules="[v => !!(v && v.length) || 'Item is required']"

All 2 comments

!![] resolves to true

:rules="[v => !!(v && v.length) || 'Item is required']"

!![] resolves to true

:rules="[v => !!(v && v.length) || 'Item is required']"

Thank you @jacekkarczmarczyk for your help.

Was this page helpful?
0 / 5 - 0 ratings