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
Not sure how the session state this handled under the hood, do you have any quick work around ? Or if you have any idea where the bug can come from, please points me the function I can have a look.
The text was updated successfully, but these errors were encountered:
if self._session_state.get(streamlit_kwargs["key"]) is None:
if property.get("init_value") is not None:
streamlit_kwargs["value"] = number_transform(property["init_value"])
elif property.get("default") is not None:
streamlit_kwargs["value"] = number_transform(property["default"]) # type: ignore
else:
if "min_value" in streamlit_kwargs:
streamlit_kwargs["value"] = streamlit_kwargs["min_value"]
elif number_transform == int:
streamlit_kwargs["value"] = 0
else:
# Set default value to step
streamlit_kwargs["value"] = number_transform(
streamlit_kwargs["step"]
)
else:
streamlit_kwargs["value"] = number_transform(
self._session_state[streamlit_kwargs["key"]]
)
Not sure if it's made on purpose or not, if there is already a value in session_state, we use it instead of using property["init_value"]. Nothing similar in _render_single_string_input. If you confirm it's a bug i can submit a PR
Checklist
Summary
Thanks for the great library, really powerful !
I have noticed a bug that you can reproduce with the minimalist example.
Reproducible Code Example
Steps To Reproduce
When you change the init model from the select box, the string default is successfully updated but not the int.
Expected Behavior
No response
Current Behavior
No response
Is this a regression?
Debug info
Additional Information
Not sure how the session state this handled under the hood, do you have any quick work around ? Or if you have any idea where the bug can come from, please points me the function I can have a look.
The text was updated successfully, but these errors were encountered: