diff --git a/src/TabNavList/TabNode.tsx b/src/TabNavList/TabNode.tsx index 99f8c513..96d9c652 100644 --- a/src/TabNavList/TabNode.tsx +++ b/src/TabNavList/TabNode.tsx @@ -42,8 +42,14 @@ function TabNode( ref: React.Ref, ) { const tabPrefix = `${prefixCls}-tab`; + const tabRef: React.Ref = React.createRef(); React.useEffect(() => onRemove, []); + React.useEffect(() => { + if (tabRef.current && !active) { + tabRef.current.blur(); + } + }, [active]); const nodeStyle: React.CSSProperties = {}; if (tabPosition === 'top' || tabPosition === 'bottom') { @@ -101,6 +107,7 @@ function TabNode( } }} onFocus={onFocus} + ref={tabRef} > {tab}