Avoid resetting scroll state on switching tabs in tabbed container

I have a tabbed container, and my typical app flow is: browse a table in tab 1, then click to zoom into details on tab 2. The issue is that when I return to tab 1, it has reset the scroll of my table all the way back to the top

Hi @matt1 Thanks for reaching out -- I'll make a feature request to maintain the scroll position!

Hi @matt1,

While we don't yet have a component setting for maintaining the position, I wonder if you can solve this using scrollIntoView for the time being?

You could have a state variable that gets updated when you click to zoom into details on tab 2. In this example, I'm setting the variable (called scrollPosition) to be the name of the component I'll want to scroll back to when I go back to tab1:

Then, when you change back to tab 1, you could check if the state variable has been set, and if so, scroll to that component: