Skip to content

Commit

Permalink
fix: removed hasfocus from default stories
Browse files Browse the repository at this point in the history
  • Loading branch information
guidari committed Jan 19, 2024
1 parent bcbb991 commit e8bcd3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Expand Up @@ -40,6 +40,14 @@ export const Default = () => (
/>
);

Default.argTypes = {
hasFocus: {
table: {
disable: true,
},
},
};

export const Playground = (args) => <ActionableNotification {...args} />;

Playground.argTypes = {
Expand Down
18 changes: 3 additions & 15 deletions packages/react/src/components/Tabs/Tabs.tsx
Expand Up @@ -327,7 +327,6 @@ function TabList({
const nextButton = useRef<HTMLButtonElement>(null);
const [isScrollable, setIsScrollable] = useState(false);
const [scrollLeft, setScrollLeft] = useState<number>(0);
const [activeTabs, setActiveTabs] = useState<TabElement[]>([]);

let hasSecondaryLabelTabs = false;
if (contained) {
Expand Down Expand Up @@ -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]
);
Expand Down

0 comments on commit e8bcd3b

Please sign in to comment.