Checklist
Summary
Binding query params doesn't add the value to the url query string if the default is chosen
For example, in
import streamlit as st
st.selectbox(
"Choose an option:",
["Option1", "Option2", "Option3"],
index=0,
bind="query-params",
key="key1",
)
st.multiselect(
"Choose an option or more:",
["Option1", "Option2", "Option3"],
default=["Option1"],
bind="query-params",
key="key2",
)
In both widget, selecting Option1 will remove the value from the query string.
If I select Option2, it gets added to the url query string, but if I select Option1 again it get removed
I would like the default to be added in the url (or have a parameter that enables this behaviour). In dymanic apps where options and default values can change, being able to share a url containing all values (including those set to the default value), will ensure that the shared url always contains the same values even if the defaults change
Reproducible Code Example
Steps To Reproduce
No response
Expected Behavior
No response
Current Behavior
No response
Is this a regression?
Debug info
Streamlit version: 1.59.2
Python version: 3.13.13
Operating System: Ubuntu 24.04
Browser: Chrome
Additional Information
No response
Checklist
Summary
Binding query params doesn't add the value to the url query string if the default is chosen
For example, in
In both widget, selecting Option1 will remove the value from the query string.
If I select Option2, it gets added to the url query string, but if I select Option1 again it get removed
I would like the default to be added in the url (or have a parameter that enables this behaviour). In dymanic apps where options and default values can change, being able to share a url containing all values (including those set to the default value), will ensure that the shared url always contains the same values even if the defaults change
Reproducible Code Example
Steps To Reproduce
No response
Expected Behavior
No response
Current Behavior
No response
Is this a regression?
Debug info
Streamlit version: 1.59.2
Python version: 3.13.13
Operating System: Ubuntu 24.04
Browser: Chrome
Additional Information
No response