5

We are looking to auto-scroll the user to a specific point in a lightning-datatablewhen a button is clicked.

Assuming we referenced the key-field attribute data-row-key-value in the dom then in HTML I could:

  1. Get the scrollTop position of the scrollable div (let's call it tbl).
  2. Find the appropriate tr (let's call it trgt).
  3. Set tbl.scrolltop = trgt.offsetTop - tbl.offsetTop.

Is anything like this possible in LWC without access to the DOM elements through window?

0

You must log in to answer this question.

Browse other questions tagged .