122
Views
7
Comments
Avoid scroll to bottom when page load
Question
Application Type
Reactive
Service Studio Version
11.53.24 (Build 61544)

Hi,

i have a problem with all pages in my application. Using Destination object to change web page, if the content exceed the screen and became scrollable, the scrollbar scroll to bottom automatically. How i can avoid this behavior? 

I'd like that the web page not scroll automatically. Is it a default behavior?

I tried to add a javascript into OnReady event with this code but it doesn't work:

document.body.scrollTop = document.documentElement.scrollTop = 0;

2022-08-03 04-32-50
Ravi Punjwani

Hi Lorenzo,

Can you share the URL of your application? Usually it doesn't scroll all the way to the bottom of page.

2022-07-18 06-05-45
Lorenzo Levis

Hi, application contains sensitive data and i can't share it. Is it possible that the issue i caused by a list inside the page? 

Cattura.PNG
2022-08-03 04-32-50
Ravi Punjwani

You can remove the sensitive data, test it on your environment by publishing as another module, and then share the app OML file here.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Lorenzo,

this is not default behaviour, afaik.  So we'll need to see more details to be able to help.

So if you can't share the actual application, try to recreate the problem in a sample application.

Without any more info, all I can suggest is to take a look at your layout blocks for some code in on ready or one of the other events, as you say this happens in your whole application.

Dorine

2022-07-18 06-05-45
Lorenzo Levis

Creating a demo to show you my problem i find the reason of the issue!
If there is an alert item it automatically scroll there. Is this a known behavior ? 

thanks

2021-09-06 15-09-53
Dorine Boudry
 
MVP

yes,

exactly what I was aiming for !  

A problem only really exists when it is reproducable and very often, in trying to reproduce, it  ceases to be a problem ;-)

And yes, alerts are brought into view by default, as I think you would expect, after all, you can't alert your user if it is out of view.  See also this earlier post about similar topic.

Dorine

2022-07-18 06-05-45
Lorenzo Levis

Thanks! 

i solved creating a custom alert: a container with the same graphics without any specific behavior

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.