diff --git a/code/ui/components/src/tabs/tabs.hooks.tsx b/code/ui/components/src/tabs/tabs.hooks.tsx index 1b6cfafef206..41df6e93f44f 100644 --- a/code/ui/components/src/tabs/tabs.hooks.tsx +++ b/code/ui/components/src/tabs/tabs.hooks.tsx @@ -145,7 +145,8 @@ export function useList(list: ChildrenList) { const crossBorder = x + widthSum + tabWidth > rightBorder; - if (!crossBorder) { + // `!tabButton` happens when new tab has just been added + if (!crossBorder || !tabButton) { newVisibleList.push(item); }