score:2

Accepted answer

one of the way to scroll to the element is assigning a id to the div and using scrollinto that

i have done in the codesandbox below refer it shows how to scroll into a particular element even if it is nested scrollbar

edit stoic-meadow-ny3wb

code:


  const handlescrollto = () => {
    settimeout(() => {
      document.getelementbyid(`element`) &&
        document.getelementbyid(`element`).scrollintoview({
          behavior: "smooth",
          block: "center"
        });
    }, 1000);
  };



Related Query

More Query from same tag