flowbite-react icon indicating copy to clipboard operation
flowbite-react copied to clipboard

Programatically Scroll Modal.Body to the top

Open schellenbergk opened this issue 1 year ago • 1 comments

  • [ 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.

schellenbergk avatar Feb 17 '24 07:02 schellenbergk