jrieke / streamlit-analytics

👀 Track & visualize user interactions with your streamlit app
MIT License
262 stars 48 forks source link

None Selected #45

Open hansipie opened 7 months ago

hansipie commented 7 months ago

Hello,

Defining a selectbox like this : select = st.selectbox("title", ("A", "B"), index=None) ... I get a KeyError exception at main.py:162 This is caused by the default "None" value. It is changed into an empty space by "replace_empty(...)", but if selected != st.session_state.state_dict.get(label, None): goes into the "true" statement, and causes an exception.

The fix at main.py:161: if selected != st.session_state.state_dict.get(label, " "):

I make a PR or let you fix ...