Skip to content

Commit

Permalink
fix(antd/next): form step setCurrent bug (#3039)
Browse files Browse the repository at this point in the history
  • Loading branch information
McDaddy committed Apr 12, 2022
1 parent 7b8669b commit 7aba484
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/antd/src/form-step/index.tsx
Expand Up @@ -89,14 +89,12 @@ const createFormStep = (defaultCurrent = 0): IFormStep => {

const next = action.bound(() => {
if (formStep.allowNext) {
setDisplay(formStep.current + 1)
formStep.setCurrent(formStep.current + 1)
}
})

const back = action.bound(() => {
if (formStep.allowBack) {
setDisplay(formStep.current - 1)
formStep.setCurrent(formStep.current - 1)
}
})
Expand All @@ -109,6 +107,7 @@ const createFormStep = (defaultCurrent = 0): IFormStep => {
},
current: defaultCurrent,
setCurrent(key: number) {
setDisplay(key)
formStep.current = key
},
get allowNext() {
Expand Down
3 changes: 1 addition & 2 deletions packages/next/src/form-step/index.tsx
Expand Up @@ -92,14 +92,12 @@ const createFormStep = (defaultCurrent = 0): IFormStep => {

const next = () => {
if (formStep.allowNext) {
setDisplay(formStep.current + 1)
formStep.setCurrent(formStep.current + 1)
}
}

const back = () => {
if (formStep.allowBack) {
setDisplay(formStep.current - 1)
formStep.setCurrent(formStep.current - 1)
}
}
Expand All @@ -112,6 +110,7 @@ const createFormStep = (defaultCurrent = 0): IFormStep => {
},
current: defaultCurrent,
setCurrent(key: number) {
setDisplay(key)
formStep.current = key
},
get allowNext() {
Expand Down

0 comments on commit 7aba484

Please sign in to comment.