Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 10:45 UTC
docs: fix page scroll jumping to code block on navigation
Add ScrollToTop component to force scroll to top on route changes. Fumadocs code blocks have tabIndex=0 which causes the browser to scroll to them during hydration when multiple Tabs share a groupId. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 3, 2026 at 19:49 UTC
e2877ed442ceaa81964f24cbaa4dad643122a940
2 files changed
+16
docs/app/layout.tsx
+2
@@ -5,6 +5,7 @@ import { Analytics } from '@vercel/analytics/next';
5
import './global.css';
6
import { IBM_Plex_Mono } from 'next/font/google';
7
import { PostHogProvider } from '@/components/posthog-provider';
8
+import { ScrollToTop } from '@/components/scroll-to-top';
9
10
export const metadata: Metadata = {
11
title: {
@@ -100,6 +101,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
101
},
102
}}
103
>
104
+ <ScrollToTop />
105
{children}
106
</RootProvider>
107
</PostHogProvider>
docs/components/scroll-to-top.tsx
new
+14
@@ -0,0 +1,14 @@
1
+'use client';
2
+
3
+import { usePathname } from 'next/navigation';
4
+import { useEffect } from 'react';
5
+
6
+export function ScrollToTop() {
7
+ const pathname = usePathname();
8
+
9
+ useEffect(() => {
10
+ window.scrollTo(0, 0);
11
+ }, [pathname]);
12
+
13
+ return null;
14
+}