Summary
Improve the management/heuristics used to handle rendering the frontend st.tabs & st.expander React components.
Scenarios such as conditionally rendering elements before st.tabs or st.expander causes the unmount/remount of the component, therefore losing its FE state/selected tab. This is expected behavior based on the components in their current implementation, but it can be improved.
When we refactor st.tabs, we should also examine the heuristic we used to assess the selected tab:
When the number or names of the tabs change, we're now looking for the name of the active tab in the list of new tabs, and activating that one. This has the advantage that you can insert tabs and still keep the current tab active. But it comes at the cost of tabs switching when you simply rename them
Additional Context
See related issues:
More expansive feature request for FE/BE communication of tab state:
Summary
Improve the management/heuristics used to handle rendering the frontend
st.tabs&st.expanderReact components.Scenarios such as conditionally rendering elements before
st.tabsorst.expandercauses the unmount/remount of the component, therefore losing its FE state/selected tab. This is expected behavior based on the components in their current implementation, but it can be improved.When we refactor
st.tabs, we should also examine the heuristic we used to assess the selected tab:Additional Context
See related issues:
More expansive feature request for FE/BE communication of tab state:
More expansive feature request for FE/BE communication of expander state: