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
Let VaDateInput accept a null value #4169
Conversation
…dation as they normal would with other controlls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to dig a bit deeper in this issue. This solution makes it visible "Invalid Date" in text field. I'll need to find some references on what to do if there is invalid date. Also, model value should become not null
, but props.clearValue
.
We also need a story with tests for that.
export const NullValue = () => ({
components: { VaDateInput },
data () {
return {
value: null,
}
},
template: `
[[value]]: {{ value === null ? 'null' : value }}
<VaDateInput v-model="value" clearable manual-input clear-value="null" />
`,
})
If you use the story for manual input, if you click in and then click out or tab out, it no longer throws a validation error. If you do the same but on the story for validation, it will throw the validation error as expected. |
Vuesticnullabledateinput.1.mp4 |
I added demo and fixed the validation issue... |
Ah I see. When you said demo, you meant an actual story for storybook. My bad. As far as the validation error, what error was there? I hadn't noticed anything in my testing. |
Allow a user to have a null date input. Dev's will have to handle validation as they normal would with other controls.
Description
Currently you have to provide a date input regardless of whether or not you have any rules. This just allow a user to remove the date inputted and be able to pass the form validation.
Types of changes