Scrolling in view when using view containers does not work

Hi
I have an action that will open a view and scroll down to the relevant part. This is normally quite easy by marking the container with element id and open url with #elementid as url.

However, when I try to do this from an action that first loads the subview, it does not find my element from the action. It seems it is in the context of the parent container and hence does not find the element id in the subview.

I have tried both “open url” action parameter and also run code:

document.getElementById(‘mynotes’).scrollIntoView({behavior: “smooth”, inline: “nearest”});
resolve()

TypeError: Cannot read properties of null (reading ‘scrollIntoView’)
when using url it gives no error, but does not scroll to the container.

What would be the best workaround for this? Im thinking I could set up an app variable when I want it to scroll in the subview, then an on view load action on the subcontainer. But it is quite ugly so I would rather make it work from the other action, if possible.

Thanks.

Thanks

Hei @Johan18

I’m not entirely clear on your setup based on the explanations provided. Could you please demonstrate it with screenshots? This would include visuals of the UI structure, the location of element IDs, and the actions you’re referring to. It would help me better understand the context and provide more accurate assistance.