Skip to content

Commit

Permalink
feat(array-collapse): add custom onChange func (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyChen02 authored Jun 4, 2024
1 parent 5203cb5 commit cd951c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/components/src/array-collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ const InternalArrayCollapse: ReactFC<IArrayCollapseProps> = observer(
<Collapse
{...props}
activeKey={activeKeys}
onChange={(keys: string[]) => setActiveKeys(toArr(keys).map(Number))}
onChange={(keys: string[]) => {
if (props.onChange) {
props.onChange(keys)
}
setActiveKeys(toArr(keys).map(Number))
}}
className={cls(`${prefixCls}-item`, hashId, props.className)}
>
{dataSource.map((item, index) => {
Expand Down

0 comments on commit cd951c0

Please sign in to comment.