Skip to content

Commit 2046f43

Browse files
committed
fix: adjust indicator position calculation to include scroll offset
1 parent f094a9d commit 2046f43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/Tabs.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export function Tabs({
3737
const containerRect = containerRef.current.getBoundingClientRect();
3838
const buttonRect = activeButton.getBoundingClientRect();
3939

40-
const left = buttonRect.left - containerRect.left;
40+
const left =
41+
buttonRect.left - containerRect.left + containerRef.current.scrollLeft;
4142
const width = buttonRect.width;
4243

4344
setIndicatorStyle({ left, width });

0 commit comments

Comments
 (0)