Closed formbook closed 8 months ago
Current hack to get desired behaviour
createEffect(() => {
// update tabs ...
// const tabs = [ 'tab 1', 'tab 2', 'tab 3' ]
const tabIndicator = document.querySelector('.tabs__indicator') as HTMLElement;
for (let i = 0; i < tabs.length; i++) {
if (tabs[i] === selectedTab()) {
tabIndicator.style.transform = `translateX(${tabIndicator.offsetWidth * i}px)`;
break;
}
}
});
Hi, thanks for reporting the issue.
Do you have a reproduction code, because the expected behavior seem to work fine in the doc https://kobalte.dev/docs/core/components/tabs#dynamic-tabs
Closing this issue as can't reproduce and stale, if the issue persist please comment or reopen.
Describe the bug Tab indicator doesn't stay with the selected tab when tabs are dynamically updated.
To Reproduce Steps to reproduce the behavior:
Expected behavior Expected the indicator to stay with the selected tab
Screenshots https://streamable.com/9mte9i
Desktop: