Skip to content

Commit

Permalink
fix(antd/next-components): formStep support current attribute (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored Apr 2, 2020
1 parent e2af6a7 commit 4f037d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/antd-components/src/form-step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export const FormStep: React.FC<IVirtualBoxProps<IFormStep>> &
name,
children
}: ISchemaVirtualFieldComponentProps) => {
const { dataSource, ...stepProps } = schema.getExtendsComponentProps()
const [{ current }, setFieldState] = useFieldState({
current: 0
current: stepProps.current || 0
})
const ref = useRef(current)
const { dataSource, ...stepProps } = schema.getExtendsComponentProps()
const items = toArr(dataSource)

const matchUpdate = createMatchUpdate(name, path)
Expand Down
4 changes: 2 additions & 2 deletions packages/next-components/src/form-step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export const FormStep: React.FC<IVirtualBoxProps<IFormStep>> &
schema,
children
}: ISchemaVirtualFieldComponentProps) => {
const { dataSource, ...stepProps } = schema.getExtendsComponentProps()
const [{ current }, setFieldState] = useFieldState({
current: 0
current: stepProps.current || 0
})
const ref = useRef(current)
const { dataSource, ...stepProps } = schema.getExtendsComponentProps()
const items = toArr(dataSource)
const batchUpdate = createMatchUpdate(name, path)
const update = (cur: number) => {
Expand Down

0 comments on commit 4f037d1

Please sign in to comment.