prevent premature modal form submission with enter click

This commit is contained in:
dandds
2019-03-27 14:01:23 -04:00
parent 21a1cc4c1f
commit 77ed7d9ab6
3 changed files with 14 additions and 4 deletions

View File

@@ -18,7 +18,9 @@ export default {
optionsinput,
},
props: {},
props: {
steps: Number,
},
data: function() {
return {
@@ -65,6 +67,15 @@ export default {
handleModalOpen: function(_bool) {
this.step = 0
},
_onLastPage: function() {
return this.step === this.steps - 1
},
handleSubmit: function(e) {
if (this.invalid || !this._onLastPage()) {
e.preventDefault()
this.next()
}
},
},
computed: {},