Skip to content

st.checkbox(message) same object for same message.  #386

@cjbumgardner

Description

@cjbumgardner

Summary

This is perhaps less of a bug and more of an issue with awkward functionality. Using st.checkbox(message) more than once (same message) in code will cause all to be set to True or False if only one is checked. If I slightly change the message in each, it fixes the issue. But, when I'm using this as a feature like "More Information", I would like to be able to reuse this checkbox message for consistency.

Steps to reproduce

What are the steps we should take to reproduce the bug:
code:

if st.checkbox("More Information"):
    st.markdown("This is a cool feature that does this....")
if st.checkbox("More Information"):
   st.markdown("This is another cool feature that does something else...")

Clicking on the first or second checkboxes causes them both to evaluate to True or False.

Expected behavior:

They should be cached independently.

Actual behavior:

The cached value of st.checkbox is relative to the message in checkbox (checkbox object is created only when message is different). If this is the intended functionality, then is it possible to create a new checkbox object with the same message?

Debug info

  • Streamlit version: 0.47.4
  • Python version: 3.6.8
  • Using Conda? PipEnv? PyEnv? Pex? No
  • OS version: ubuntu:18.04 (docker base image)
  • Browser version: Chrome

Metadata

Metadata

Assignees

Labels

area:onboardingBugs impacting initial user experience: installation and demostype:bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions