Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlit 1.12.0 doesn't allow the same key for widgets with different labels #5164

Closed
blackary opened this issue Aug 15, 2022 · 1 comment
Closed
Labels
status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working

Comments

@blackary
Copy link
Collaborator

Summary

Before streamlit 1.12.0, It used to be that if you had widgets with different labels but the same key, that was fine. Now, any two widgets of the same type with the same key cause a DuplicateWidgetID error.

Steps to reproduce

Code snippet:

import streamlit as st

st.checkbox("Label1", key=1)

st.checkbox("Label2", key=1)

Expected behavior:

No error raised

Actual behavior:

DuplicateWidgetID raised

Is this a regression?

Yes. It worked fine on streamlit < 1.12.0

Debug info

  • Streamlit version: (get it with $ streamlit version) 1.12.0
  • Python version: (get it with $ python --version) 3.10.3
  • Using Conda? PipEnv? PyEnv? Pex?
  • OS version:
  • Browser version:

Additional information

Originally reported on forum https://discuss.streamlit.io/t/streamlit-version-1-12-bug/29099/3

@blackary blackary added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Aug 15, 2022
@blackary blackary changed the title Streamlit 1.12.0 doesn't allow the same key for widgets with different names Streamlit 1.12.0 doesn't allow the same key for widgets with different labels Aug 15, 2022
@kajarenc
Copy link
Collaborator

Hello hello @blackary !

Actually, this is not a bug, but a feature :)

I implemented that here #5000 since previous behavior breaks our principle to not allow different widgets with the same user key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants