You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is VForm suppose to have a valid value of true if a required field is programmatically set to null or undefined?
If this is intended behavior, how do you clear a field without making the label float?
Like this:
Instead of:
I understand that an empty string is considered a valid value (as discussed here), but this raises the question: how can you clear a field and trigger validation without causing the label to float? Should null or undefined trigger form validation?
How to Reproduce
Go to example
Click on Set to null or Set to undefined
See that valid stays true
Click on Set to empty string
See that valid is false but the label floats
Example
In this example a VSelect component is used, but it can also be reproduced with a VTextField component.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Is
VForm
suppose to have a valid value oftrue
if a required field is programmatically set tonull
orundefined
?If this is intended behavior, how do you clear a field without making the label float?
Like this:
Instead of:
I understand that an empty string is considered a valid value (as discussed here), but this raises the question: how can you clear a field and trigger validation without causing the label to float? Should
null
orundefined
trigger form validation?How to Reproduce
Set to null
orSet to undefined
true
Set to empty string
false
but the label floatsExample
In this example a
VSelect
component is used, but it can also be reproduced with aVTextField
component.https://play.vuetifyjs.com/#eNqVU09PvDAQ/SojF3YTWfL7xYPZsEaPelCjiRfxUGEwjaVgW4gG97s70+LCrhe90Pa9N386fTwOkTVFetG2q77DaB1lDutWCYdnuQbI+kS0rd/6Q9FoJ6RGM0IerBpTg8Fqk0e8zSPok7opURHQCyXLPNrJfYBFhYWbIJgFSKqfR3NubTqFlii/HnAsZ86v+5wSzz7jrUJhEUJREBoOS6Tz7krZQ6GE5aRlUil8hxeRnEDtkpO9e/ibPDsN54WSxevYA2xAd0qR8h4duMafstQrfxPc6RIrGjDPbMywg/6QJo6neHpP9wHWGalffpPCoEVH4Xe8/gzIUhrR9PzE86NPQGtwN0Aa2une0C6pvTXAMMDV/c31KjQlq48F972E7XaSPrBz1iz1HppxWUo1vj1J9fdNyUjwbJbOvExHWxjZOjKC64KlZd02xsHA5oUtVKapIabfIGY5AOW1Dry7NyxZLCc09BTgSiiLM258A6Zi3v+LZ6Q38cg+9rA5g6OjHj4/Ib7Dt04aLOOng1w7+ZjtGPzmvxeytOp04WSjSUWXWyxhCMPh1lfUaYerkQk4RwecrRKSMkMTztIwJZpPtD1m8/rP0xe6H0fe
Beta Was this translation helpful? Give feedback.
All reactions