mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-07-28 00:15:01 +00:00
UI: expose useAutoScroll()
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user