From 516e30c25e1c24a992a7efdd04d5de9897c53fe9 Mon Sep 17 00:00:00 2001 From: xiamiao1121 <74885998+xiamiao1121@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:41:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(tabs):=20=E4=BF=AE=E5=A4=8DactiveId?= =?UTF-8?q?=E4=B8=BA=E4=B8=80=E4=B8=AA=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E6=88=96=E7=A9=BA=E5=80=BC=EF=BC=8C=E4=B8=8B=E5=88=92?= =?UTF-8?q?=E7=BA=BF=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98(#2939)=20(#2940)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(tabs): 修复activeId为一个不存在的值或空值,下划线显示不对的问题(#2939) * chore(tabs): 生成变更记录文件 --------- Co-authored-by: xiamiao --- .changeset/eight-poets-reply.md | 5 +++++ .changeset/sweet-garlics-shop.md | 5 +++++ packages/ui/tabs/src/TabList.tsx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/eight-poets-reply.md create mode 100644 .changeset/sweet-garlics-shop.md diff --git a/.changeset/eight-poets-reply.md b/.changeset/eight-poets-reply.md new file mode 100644 index 000000000..f608a9dcf --- /dev/null +++ b/.changeset/eight-poets-reply.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(tabs): 修复 activeId 为一个不存在的值或空值,下划线显示不对的问题 diff --git a/.changeset/sweet-garlics-shop.md b/.changeset/sweet-garlics-shop.md new file mode 100644 index 000000000..13f64c7df --- /dev/null +++ b/.changeset/sweet-garlics-shop.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/tabs": patch +--- + +fix: 修复 activeId 为一个不存在的值或空值,下划线显示不对的问题 diff --git a/packages/ui/tabs/src/TabList.tsx b/packages/ui/tabs/src/TabList.tsx index e867a42c8..7508770bf 100644 --- a/packages/ui/tabs/src/TabList.tsx +++ b/packages/ui/tabs/src/TabList.tsx @@ -253,7 +253,7 @@ export const TabList = forwardRef( direction={direction} /> ))} - {type === 'line' ? ( + {type === 'line' && data.some((item) => item.tabId === activeTabId) ? (