From e8bcd3bcbe643cb59335f2c1821a597bfa411d27 Mon Sep 17 00:00:00 2001 From: guidari Date: Fri, 19 Jan 2024 12:10:15 -0300 Subject: [PATCH] fix: removed hasfocus from default stories --- .../stories/ActionableNotification.stories.js | 8 ++++++++ packages/react/src/components/Tabs/Tabs.tsx | 18 +++--------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/react/src/components/Notification/stories/ActionableNotification.stories.js b/packages/react/src/components/Notification/stories/ActionableNotification.stories.js index b5e7c31214f3..5000132db918 100644 --- a/packages/react/src/components/Notification/stories/ActionableNotification.stories.js +++ b/packages/react/src/components/Notification/stories/ActionableNotification.stories.js @@ -40,6 +40,14 @@ export const Default = () => ( /> ); +Default.argTypes = { + hasFocus: { + table: { + disable: true, + }, + }, +}; + export const Playground = (args) => ; Playground.argTypes = { diff --git a/packages/react/src/components/Tabs/Tabs.tsx b/packages/react/src/components/Tabs/Tabs.tsx index 566c2e0bd76f..ce289caf30f7 100644 --- a/packages/react/src/components/Tabs/Tabs.tsx +++ b/packages/react/src/components/Tabs/Tabs.tsx @@ -327,7 +327,6 @@ function TabList({ const nextButton = useRef(null); const [isScrollable, setIsScrollable] = useState(false); const [scrollLeft, setScrollLeft] = useState(0); - const [activeTabs, setActiveTabs] = useState([]); let hasSecondaryLabelTabs = false; if (contained) { @@ -399,26 +398,15 @@ function TabList({ }, scrollDebounceWait); }, [scrollDebounceWait]); - useEffect(() => { - setActiveTabs([]); - console.log('tabs', tabs); - const filteredTabs: TabElement[] = tabs.current.filter( - (tab) => !tab.disabled - ); - - setActiveTabs(filteredTabs); - // console.log('activeTabs UseEffect', activeTabs); - }, [tabs]); - function onKeyDown(event: KeyboardEvent) { if ( matches(event, [keys.ArrowRight, keys.ArrowLeft, keys.Home, keys.End]) ) { event.preventDefault(); - // filterTabs(); - console.log('onKeyDown'); - console.log('activeTabs', activeTabs); + const activeTabs: TabElement[] = tabs.current.filter( + (tab) => !tab.disabled + ); const currentIndex = activeTabs.indexOf( tabs.current[activation === 'automatic' ? selectedIndex : activeIndex] );