The CreatorCon Call for Content is officially open! Get started here.

How to restore the scroll position when returning with history.back() on the portal

Ohki_Yamamoto
Tera Guru

 

In the /csm portal, we are implementing a process to return to the screen using history.back().

 

Usually, when history.back() is used, the scroll position and other states of the source screen are restored, but with ServiceNow, the scroll position is not restored and the screen is returned to the initial display state. (Scrolling is back to the top of the screen)

 

Is there a way to restore the scroll position in the return transition of each screen on the portal?
We are considering using UI Script to achieve this, but it is not working well.

 

1 REPLY 1

Ohki_Yamamoto
Tera Guru

The following Community article is a test
This one allows you to keep scrolling when the standard UI form screen loads, but it did not seem to be available on the portal.

https://www.servicenow.com/community/developer-forum/how-to-keep-the-page-scroll-position-even-after... page/2