Skip to content

Commit

Permalink
fix(react): fix CompositePanel
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Oct 14, 2021
1 parent 2c2237c commit bf4ba3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/panels/CompositePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,17 @@ export const CompositePanel: React.FC<ICompositePanelProps> & {
key={index}
href={item.href}
onClick={(e: any) => {
const key = item.key ?? index
if (shape === 'tab') {
if (activeKey === index || activeKey === item.key) {
setVisible(!visible)
} else {
setVisible(true)
}
setActiveKey(index)
setActiveKey(key)
}
item.onClick?.(e)
props.onChange?.(item.key ?? index)
props.onChange?.(key)
}}
>
{takeTab()}
Expand Down

0 comments on commit bf4ba3f

Please sign in to comment.