From d08b57c25ab9714e4de488dfcb2a913510d6dfc8 Mon Sep 17 00:00:00 2001 From: Heising Date: Fri, 3 Nov 2023 12:40:30 +0800 Subject: [PATCH] fix(tabs): fix tabs onchange trigger multiple items --- src/tabs/TabNav.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tabs/TabNav.tsx b/src/tabs/TabNav.tsx index 87e91c53cd..7d44f22de8 100644 --- a/src/tabs/TabNav.tsx +++ b/src/tabs/TabNav.tsx @@ -209,7 +209,9 @@ const TabNav: React.FC = (props) => { const handleTabItemClick = (clickItem) => { tabClick(clickItem.value); - onChange(clickItem.value); + if (activeValue !== clickItem.value) { + onChange(clickItem.value); + } clickItem?.onClick?.(clickItem.value); };