UI Builder - scroll to the top of the page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2025 12:05 PM
On UI Builder is possible to scroll to the top of the page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2025 08:40 PM
Scrolling is possible by calling the following client script:
function handler({api, event, helpers, imports}) {
helpers.timing.setTimeout(function (){
this.top.window.scroll({
top: 0,
behavior: "smooth",
});
}, 100);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 07:19 AM
Hi @HidekiOgawa ,
Looks like nothing happen.
I have an form, actually the catalog item component, after submit the form if validation fails, an event is trigger (it shows alert notification at the top of the page). I added an event handler that runs a client script with the code that you provided.
Any idea why it is not working?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 07:27 AM
Hi @valter479,
You can try this in your client handler:
function handler({helpers}) {
helpers.timing.setTimeout(() => {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
}, 100);
}
Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 07:58 AM
HI @Ehab Pilloor ,
window is undefined.
I tried "this.window.scrollTo(...)" and this.window.scroll(...)" but both didn't worked.
Thanks,
Valter