Forum Academy Marketplace Showcase Pricing Features

Automatic scrolling to the top because of a "hide" action in a workflow

I’ve got a very strange problem.

I built a button, when you click on it it displays two groups and when you click on it again it hides them. I didn’t use the “toggle” action because I have similar buttons that share one of the two groups so instead I used “show” and “hide” actions (and one condition).

When i click on the button to hide the two groups, my page automatically scrolls to the top, which is really annoying. I noticed that by removing one “hide” action in the workflow (hide group whats happening), it doesn’t scroll to the top.
Aide

I really don’t understand what is triggering this…
Has anyone ever had such problem ?

Thanks!!

EDIT : it looks like these guys had the same problems years ago but no replies.

Maybe those groups you are hiding have the ‘collapse elements height when hidden’ which causes the height of the page to decrease when they are hidden

yes they do have the collapse function, but the buttons are at the top of these groups and there is enough content over the buttons not to scroll to the top.

I don’t see any buttons in the screen shots so not sure about the reference.

Perhaps try it and uncheck the setting to collapse height when hidden on the two groups and see if it still triggers the scroll…if it doesn’t than the collapse height would be the issue…if it still triggers the scroll then it is not the issue and you could focus the investigation of the cause on something else, like perhaps a workflow that is scroll to element.

Uncheck the collapse height and let me know if it stops the scroll

Sorry i was taking the screenshot

EDIT : I tried to uncheck the collapse of both groups in the same time, then one with it and one without it, and it still scrols to the top.

And what happens if you uncheck the collapse height options on the groups? Does it still scroll up when they are hidden?

Then you should run the app in debug step by step mode to see what workflows are triggered when you hide the groups to see if there is an event somewhere causing the scroll.

Thank you!!!

So the problem was coming from the fact that for one button I had two workflows : one " button is clicked and X is visible" and “button is clicked and X isn’t visible” but I had forgotten the “X isn’t visible” in the condition, so two workflows would run doing exactly opposite things, which, I think, confused the browser and triggered this scrolling to top!!

Thank you @boston85719 for taking the time to help me!

Did you find that out using the step by step mode of the debugger?

yes, I realised that it was launching two workflows after only one!

1 Like