You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The option menu UI refresh and back to the default after the st.experimental_set_query_params runs
I tried to use the session state to store the index but no luck. The value is correct just the UI is incorrect.
Here is the detail:
I have a menu inside the sidebar like this
When I click the third option it supposed to become this, the third option will be highlighted
but after the page runs the st.experimental_set_query_params
The UI of the option menu will refresh itself and become this
even the third option is selected indeed (the value is correct just the UI is not correct)
I don't know if and how we can solve this in the component's level, since streamlit reloads the page when the experimental_set_query_params is being used, which means the whole component is reloads, so you see the component with its initial (default) value.
A simple workaround you can do is to save the state and insert it as a default_value:
@fgdvir Thank You for the reply!
I have tried but no luck =[
One thing might be helpdful is the highlight is in the correct option when I using direct link (URL with query params).
Summary
The option menu UI refresh and back to the default after the st.experimental_set_query_params runs
I tried to use the session state to store the index but no luck. The value is correct just the UI is incorrect.
Here is the detail:
I have a menu inside the sidebar like this
![](https://camo.githubusercontent.com/8e231f0935ddc4fa971f3e8e28b098600dd115172654397fe855b60bd8b553bd/68747470733a2f2f692e6962622e636f2f485464374e547a2f53637265656e73686f742d323032332d30312d30362d61742d31312d35382d33382e706e67)
When I click the third option it supposed to become this, the third option will be highlighted
![](https://camo.githubusercontent.com/bcd30a7dcf879de683f20b6db98e7ff5549f8fc1715e675d84b4383768d5febb/68747470733a2f2f692e6962622e636f2f664d47575435542f53637265656e73686f742d323032332d30312d30362d61742d31322d30302d32342e706e67)
but after the page runs the st.experimental_set_query_params
![](https://camo.githubusercontent.com/8e231f0935ddc4fa971f3e8e28b098600dd115172654397fe855b60bd8b553bd/68747470733a2f2f692e6962622e636f2f485464374e547a2f53637265656e73686f742d323032332d30312d30362d61742d31312d35382d33382e706e67)
The UI of the option menu will refresh itself and become this
even the third option is selected indeed (the value is correct just the UI is not correct)
![](https://camo.githubusercontent.com/5af34f4930202c5763abb4b37087f5653be732290feecae6dc36e5551cd5ab87/68747470733a2f2f692e6962622e636f2f52305444395a632f53637265656e73686f742d323032332d30312d30362d61742d31322d30312d30352e706e67)
Reproducible Code Example
Steps To Reproduce
Debug info
The text was updated successfully, but these errors were encountered: