scrollTo an specific element in new component

I have a customized list feature with select boxes on modal.

expected behavior -> scroll to the selected list option on modal open.
here is what i tried.

const el = document.getElementById('elementToView');
el.scrollIntoView({block: "end", inline: "nearest"});

neither of them worked.

is there any way to work around ?
Thank you.

Hey @j_ah – JS in Retool is sandboxed so you won't be able to use parent window functions. We used to have a .scrollIntoView() function for container components, but it looks like we've deprecated that. Let me see what I can dig up....

@justin similar question on my end - was wondering, if .scrollIntoView() was brought back into the fold?

We're reloading a single view when the user presses "next" in our application and would love to be able to reset the view so that the user gets to see the top of the page, upon the re-render.

Hi @schopra

Thanks for reaching out -- we are working through all components and adding .scrollIntoView() :blush: It's still in progress so I don't have a timeline, but I'll post here when it's shipped