Skip to content

Commit

Permalink
fix(next): fix FormTab activeKey bug (#1945)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grapedge authored Aug 3, 2021
1 parent 7592baf commit 2902447
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/src/form-tab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Fragment, useMemo } from 'react'
import { Tab as Tabs, Badge } from '@alifd/next'
import { model } from '@formily/reactive'
import { isValid } from '@formily/shared'
import {
ItemProps as TabPaneProps,
TabProps as TabsProps,
Expand Down Expand Up @@ -90,8 +91,8 @@ export const FormTab: ComposedFormTab = observer(({ formTab, ...props }) => {
return (
<Tabs
{...props}
{...(isValid(activeKey) && { activeKey })}
className={cls(prefixCls, props.className)}
activeKey={activeKey}
onChange={(key) => {
props.onChange?.(key)
formTab?.setActiveKey?.(key)
Expand Down

0 comments on commit 2902447

Please sign in to comment.