Vuetify: [Bug Report] v-edit-dialog ignores 'rules'

Created on 20 Feb 2018  路  8Comments  路  Source: vuetifyjs/vuetify

Versions and Environment

Vuetify: 1.0.2
Vue: 2.5.13
Browsers: Chrome 63.0.3239.132
OS: Windows 10

Steps to reproduce

Click a cell to show the inline editor.

Enter more chars than rule allows (25).

Hit enter or click anywhere.

Expected Behavior

Rule violation causes underlying value not to update when editor is closed.

Actual Behavior

Underlying value is updated.

Reproduction Link

https://codepen.io/anon/pen/PQRBrx

Other comments

I had assumed the :rules would act as a gate to prevent bad input?

(Codepen is taken from stock v-edit-dialog example pen)

VDataTable VEditDialog enhancement

Most helpful comment

@jacekkarczmarczyk Checking errors would work only if user uses vuetify's validations. It would break if user tries to validate by using vuelidate or vee-validate.

By using native events, without changing lots of things the choice could be left to the user. But we must use these events by using .native modifier.
Ex:
<v-edit-dialog @save.native="save" >
And in the save method we could prevent dialog by calling event.preventDefault()
I could create a pull request if that's ok.

All 8 comments

@jacekkarczmarczyk any insight?

I'd get rid of v-edit-dialog component in the first place (afair we've discussed it with The Kael), but that's definitely not something for 1.0.*.
Checking errors before saving seems to be the right solution

Is there any workaround for that? There is even no possibility to add custom listener to prevent save.

@jacekkarczmarczyk Checking errors would work only if user uses vuetify's validations. It would break if user tries to validate by using vuelidate or vee-validate.

By using native events, without changing lots of things the choice could be left to the user. But we must use these events by using .native modifier.
Ex:
<v-edit-dialog @save.native="save" >
And in the save method we could prevent dialog by calling event.preventDefault()
I could create a pull request if that's ok.

PRs are always welcome :)

@ayZagen i have just spend 3 hour on this issue before see this thread.
Your solution is what i need.

@oxi049 no worries, i just need a little spare time.

This component is being removed for v3. We haven't nailed down the exact replacement functionality but there will be an upgrade path.

If you have any additional questions, please reach out to us in our Discord community.

Was this page helpful?
0 / 5 - 0 ratings