How to know when element is visible in order to focus it?

0
Hello Mendix community! I have a page with questions and, based on responses, child questions are loaded into the DOM. For accessibility I need to focus the first child question after the element has loaded. I've tried several approaches, including using a MutationObserver script (fires too often), a Microflow timer on the child element (works, but when the page loads later with the given responses it focuses the last child question instead of the top of the page). What I really want is an event that fires when the elements have rendered so I can control when the first one is focused. Is there any elegant way to do this with Mendix? Thanks, Mignonne Maxwell
asked
2 answers
0

Maybe this component from the marketplace can help you out: https://marketplace.mendix.com/link/component/107276

It is a bit of on old component, but you might get some idea on how to implement this in your version of Mendix.

answered
0

I found a workaround for this issue using a setTimeout inside a JS action. Imprecise, but working.

answered