Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
#37 Validate all steps when going more than one step
Browse files Browse the repository at this point in the history
  • Loading branch information
cristijora committed Aug 28, 2017
1 parent d52aa9b commit 899b8ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/FormWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,13 @@
let validate = index > this.activeTabIndex
if (index <= this.maxStep) {
let cb = () => {
this.changeTab(this.activeTabIndex, index)
if (validate && index - this.activeTabIndex > 1) {
// validate all steps recursively until destination index
this.changeTab(this.activeTabIndex, this.activeTabIndex + 1)
this.beforeTabChange(this.activeTabIndex, cb)
} else {
this.changeTab(this.activeTabIndex, index)
}
}
if (validate) {
this.beforeTabChange(this.activeTabIndex, cb)
Expand Down

0 comments on commit 899b8ab

Please sign in to comment.