We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3fd5ea commit 2b81a88Copy full SHA for 2b81a88
1 file changed
frontend/app/tab/vtabbar.tsx
@@ -144,7 +144,15 @@ export function VTabBar({ workspace, className }: VTabBarProps) {
144
}
145
const el = scrollContainerRef.current.querySelector(`[data-tabid="${activeTabId}"]`);
146
el?.scrollIntoView({ block: "nearest" });
147
- }, [activeTabId, documentHasFocus]);
+ }, [activeTabId]);
148
+
149
+ useEffect(() => {
150
+ if (!documentHasFocus || activeTabId == null || scrollContainerRef.current == null) {
151
+ return;
152
+ }
153
+ const el = scrollContainerRef.current.querySelector(`[data-tabid="${activeTabId}"]`);
154
+ el?.scrollIntoView({ block: "nearest" });
155
+ }, [documentHasFocus]);
156
157
const stopScrollLoop = useCallback(() => {
158
if (scrollAnimFrameRef.current != null) {
0 commit comments