We are looking to auto-scroll the user to a specific point in a lightning-datatable
when a button is clicked.
Assuming we referenced the key-field
attribute data-row-key-value
in the dom then in HTML I could:
- Get the
scrollTop
position of the scrollable div (let's call ittbl
). - Find the appropriate
tr
(let's call ittrgt
). - Set
tbl.scrolltop = trgt.offsetTop - tbl.offsetTop
.
Is anything like this possible in LWC without access to the DOM elements through window
?