Skip to content

Commit

Permalink
feat(blocks-antd): Trigger onChange event when active key changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gervwyk committed Nov 15, 2023
1 parent c804c18 commit 0c1908e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const TabsBlock = ({ blockId, components: { Icon }, events, content, methods, pr
useEffect(() => {
if (properties.activeKey !== key) {
setKey(properties.activeKey);
methods.triggerEvent({ name: 'onChange', event: { activeKey: properties.activeKey } });
}
}, [properties.activeKey]);

Expand All @@ -63,7 +64,6 @@ const TabsBlock = ({ blockId, components: { Icon }, events, content, methods, pr
methods.triggerEvent({ name: 'onTabScroll', event: { direction } })
}
onTabClick={(key) => {
setKey(key);
methods.triggerEvent({ name: 'onTabClick', event: { key } });
}}
items={tabs.map((tab) => ({
Expand Down

0 comments on commit 0c1908e

Please sign in to comment.