Vuetify: v-text-field with label, placeholder and required does not get marked as invalid on blur

Created on 10 Aug 2017  路  2Comments  路  Source: vuetifyjs/vuetify

Steps to reproduce

Setup the template ("yourProp" is empty):

<v-text-field label="Label" placeholder="Holder" v-model="yourProp" required></v-text-field>

In runtime, set focus to the field, then remove focus.

Versions

0.14.8

What is expected ?

Field should be marked as invalid ($theme.error color), as view field and model are still empty.

What is actually happening ?

Field behaves as if it has content.

Reproduction Link

https://jsbin.com/quposazuha/edit?html,js,output

bug

Most helpful comment

This is changing next release in how it works. Required will no longer automatically trigger any type of validation. It will simply supply the asterisk in the label. Here is an example of how you could trigger the validation:

<v-text-field
      label="No placeholder"
      v-model="model1"
      required
      :rules="[() => model1.length > 0 || 'Required field']"
></v-text-field>

<v-text-field
      label="With placeholder"
      placeholder="hey"
      v-model="model2"
      required
      :rules="[() => model2.length > 0 || 'Required field']"
></v-text-field>

All 2 comments

This is changing next release in how it works. Required will no longer automatically trigger any type of validation. It will simply supply the asterisk in the label. Here is an example of how you could trigger the validation:

<v-text-field
      label="No placeholder"
      v-model="model1"
      required
      :rules="[() => model1.length > 0 || 'Required field']"
></v-text-field>

<v-text-field
      label="With placeholder"
      placeholder="hey"
      v-model="model2"
      required
      :rules="[() => model2.length > 0 || 'Required field']"
></v-text-field>

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

Was this page helpful?
0 / 5 - 0 ratings

Related issues

milleraa picture milleraa  路  3Comments

Webifi picture Webifi  路  3Comments

efootstep picture efootstep  路  3Comments

itanka9 picture itanka9  路  3Comments

jofftiquez picture jofftiquez  路  3Comments