flowbite-react
flowbite-react copied to clipboard
Programatically Scroll Modal.Body to the top
- [ Yes] I have searched the Issues to see if this bug has already been reported
- [Yes ] I have tested the latest version
Summary
I tried:
// reset scroll:
const modalBody = useRef<HTMLDivElement>(null);
useEffect(() => {
if (modalBody.current) modalBody!.current!.scrollTop = 0;
}, [trigger, modalBody]);
...
<Modal.Body
className="p-0 min-h-[300px] aspect-[30/13]"
ref={modalBody}
>...
but ref is not being passed.