Is it possible for me to manually scroll up the screen

It possible for me to manually scroll up the screen using manual js code like
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;

Hey there @rakeen! Sorry for the delay :confused:

Unfortunately we don’t expose these utilities in Retool quite yet, as JS is sandboxed from the DOM :frowning:

@rakeen One idea that comes to mind: we did recently add a .scrollIntoView() JS method for the Container component. If you call that in a Run JS Code query it will scroll to wherever that container component is!

https://docs.retool.com/docs/scripting-retool#containerscrollintoviewbehavior-string

@alex-w How would that work for a specific element inside a component? For an example if we have a long timeline, and we want to scroll to the most recent item.

Sorry for the delay here, you might have seen we just added the ability to reverse the timeline component order which should help with this!

hi Alex. does this really only work for the container element?

Yes I believe the .scrollIntoView() method has only been implemented for container components at the moment. If there are there specific use cases that are coming to mind, that would be a great feature request for us to add!

Hi Alex,

I thought I would just hijack this thread instead of opening a new one as it is connected to the topic of the thread.

Unfortunatly the scrollIntoView() function does not work for me when using the app. In the editor mode it works perfectly fine.

Any ideas on this problem?

Best, Timo

@betternet

We tried replicating this on our end and while it does not seem to work on the new container component it does work on the deprecated container component. If you go to your org settings, under the beta tap you can toggle on deprecated components. You should then be able to see the deprecated container below:

Hi Grace, first of all thanks for getting back to me.
I do not think that changing my container components back to the deprecated ones is a solution for me. I would like to see a general fix of this issue as it seems to be quite an important functionality.
Best, Timo

@betternet

You're welcome! We have a report in place for this issue and we will be adding the .scrollIntoView() method to the new component soon. I am not able to provide a timeline on when that will be added but I linked this community post to our report and we will notify you when we have any updates. I wish I had better news for you, but can only offer this workaround for the time being.

Best,

Lauren

3 Likes

Hi Lauren,

no worries and thank you for reporting this issue internally!

Best, Timo

Hi all, just to upvote here. Please fix this asap or even better make it available in all elements. Thank you!

3 Likes

Adding my vote to this - we really need the ability to scroll to a specific location (i was really surprised it wasn't an option)

Has there been any movement on this?

1 Like