From 3275b9e47a16f36279579153558563f09f1b054d Mon Sep 17 00:00:00 2001 From: Francisco Mazzoni Date: Tue, 8 Nov 2022 18:54:46 -0300 Subject: [PATCH] default active tab to first panel if present, otherwise uses url hash --- packages/ui/src/components/Tabs/Tabs.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/Tabs/Tabs.tsx b/packages/ui/src/components/Tabs/Tabs.tsx index da9de69154f..9145c37d776 100644 --- a/packages/ui/src/components/Tabs/Tabs.tsx +++ b/packages/ui/src/components/Tabs/Tabs.tsx @@ -55,8 +55,8 @@ function Tabs({ let __styles = styleHandler('tabs') // activeId state can be overriden externally with `active` - // defaults to use a url #hash if we have one or activeTab if not - const active = activeId ? activeId : hash ? hash : activeTab + // defaults to the first panelif we have one or url hash if not + const active = activeId ? activeId : activeTab ? activeTab : hash function onTabClick(id: string) { const newTabSelected = id !== active