Checklist
Summary
According this comment, it is fine to supply a default value to a widget and also have it set via the Session State API.
streamlit issues a warning, however, if you do that.
Reproducible Code Example
import streamlit as st
st.session_state["key"] = 1
st.slider("slider", min_value = 0, max_value = 10, value=9, key="key")
Steps To Reproduce
No response
Expected Behavior
No warnings.
Current Behavior
Warning:
The widget with key "key" was created with a default value but also had its value set via the Session State API.
Is this a regression?
Debug info
- Streamlit version: 1.58.0
Additional Information
No response
Checklist
Summary
According this comment, it is fine to supply a default value to a widget and also have it set via the Session State API.
streamlit issues a warning, however, if you do that.
Reproducible Code Example
Steps To Reproduce
No response
Expected Behavior
No warnings.
Current Behavior
Warning:
Is this a regression?
Debug info
Additional Information
No response