Javascript Focus Function doesn't scroll to focus

I feel like this should work.
I have a tabbed menu with a form that is longer than the screen. to ease user experience I moved the submit button to the last tab and added a button to each tab to move to next tab.
moving to the next tab works, but since the button is at the bottom, it positions me at the bottom of the next tab.

here is my event and script.

This is attempting to focus on the first field of the next tab.
I've tried to focus on the segmented control of the tabbed menu.
I've tried focusing on the top of the form completely.
none of the focuses are scrolling anywhere.

maybe I am misunderstanding what this should do, or maybe I messing it up. any assistance would be appreciated.
thanks
-Aaron

Hi, maybe you are looking for ScrollIntoView() function

scrollIntoView() scrolls until the component is in the viewport

focus() focuses in the component to type in it so user dont need to click on the component

using this, it doesn't seem to be working on mobile.

is it just a limitation in Mobile?

There is a known issue with trying to interact with components that are in different container views/tabs

try setting a debounce of 100-500ms
or ensure that you call the .scrollIntoView() when the component is in the current view

nope. checkbox 13 is slightly above the view it's not scrolling or anything :confused:

try setting it like this instead
image

must be an issue with mobile development because that option isn't available from the method dropdown.

it seems like mobile env doesnt have scrollIntoView() function

it doesnt even suggest an autocompletation for that

maybe this needs to be a feature request instead of a bug.

Thanks

1 Like

Hey @Shegs, able to reproduce the scrollIntoView method not working on mobile apps. We are tracking this internally and will update you here.

1 Like