loopable / web /src /ui /OverlayScroll.tsx
fsanyoto's picture
Deploy AIOS web (React glide grid + FastAPI slice)
9a6cb9a verified
Raw History Blame Contribute Delete
592 Bytes
import { createElement, forwardRef, type HTMLAttributes } from "react";
type ScrollElement = "div" | "aside" | "nav";
type OverlayScrollProps = HTMLAttributes<HTMLElement> & { element?: ScrollElement };
// Keep the name so the three mounts stay put; R11 retired the overlay in favour of native scrolling.
export const OverlayScroll = forwardRef<HTMLElement, OverlayScrollProps>(function OverlayScroll(
{ element = "div", className, children, ...props }, ref,
) {
return createElement(
element,
{ ...props, className, ref, tabIndex: props.tabIndex ?? 0 },
children,
);
});