UI: expose useAutoScroll()

This commit is contained in:
Fuma Nama
2026-01-04 15:56:37 +08:00
parent 4248c50181
commit c804ac6e38
3 changed files with 14 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"fumadocs-ui": patch
"@fumadocs/base-ui": patch
---
expose `useAutoScroll()`
@@ -399,7 +399,10 @@ export function SidebarCollapseTrigger(props: ComponentProps<'button'>) {
);
}
function useAutoScroll(active: boolean, ref: RefObject<HTMLAnchorElement | null>) {
/**
* scroll to the element if `active` is true
*/
export function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>) {
const { mode } = useSidebar();
useEffect(() => {
@@ -387,7 +387,10 @@ export function SidebarCollapseTrigger(props: ComponentProps<'button'>) {
);
}
function useAutoScroll(active: boolean, ref: RefObject<HTMLAnchorElement | null>) {
/**
* scroll to the element if `active` is true
*/
export function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>) {
const { mode } = useSidebar();
useEffect(() => {