vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

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

Open emrdev opened this issue 8 years ago • 8 comments

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)

emrdev avatar Feb 20 '18 16:02 emrdev

@jacekkarczmarczyk any insight?

johnleider avatar Feb 20 '18 22:02 johnleider

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

jacekkarczmarczyk avatar Feb 21 '18 02:02 jacekkarczmarczyk

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

zfmaster avatar Sep 08 '18 16:09 zfmaster

@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.

ayZagen avatar Oct 19 '18 22:10 ayZagen

PRs are always welcome :)

jacekkarczmarczyk avatar Oct 20 '18 02:10 jacekkarczmarczyk

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

oxi049 avatar Oct 22 '18 22:10 oxi049

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

ayZagen avatar Oct 22 '18 23:10 ayZagen

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.

johnleider avatar Jan 19 '20 15:01 johnleider