Closed EPronovost closed 5 months ago
Sounds good!
@franekp https://github.com/franekp/streamlit-permalink/pull/9 is ready for your review when you have time, thanks!
Done. New version here: https://pypi.org/project/streamlit-permalink/0.5.2/
Thank you!
Hi! I noticed a bug where
streamlit-permalink
is unable to distinguish between "the chosen value is an empty list" and "there is no chosen value" for list-based widgets likemultiselect
. This is fine so long as the default value is also an empty list, but causes issues with a non-empty default value.For example,
I open the app at
http://localhost:8501/
and seeA
selected. If I manually click onB
the URL changes tohttp://localhost:8501/?multiselect=A&multiselect=B
as expected. If I reload the page my selections will be preserved.However, if I then clear the multiselect (such that nothing is selected) the URL goes back to
http://localhost:8501/
. If I reload the app at this point it'll go back to the default entry["A"]
, losing my selection.I believe we need something like
multiselect=_EMPTY_LIST
in the query params to address this. I'm happy to contribute the fix for this, and wanted to get your feedback before putting up a PR.