-
Notifications
You must be signed in to change notification settings - Fork 4k
Add label_visibility option for st.checkbox #5705
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
Add label_visibility option for st.checkbox #5705
Conversation
| c = self.get_delta_from_queue().new_element.checkbox | ||
| self.assertEqual(c.label, "the label") | ||
| self.assertEqual(c.label_visibility.value, proto_value) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to write a test for the 3rd scenario where label="" and the warning is raised?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test added!
| checked={this.state.value} | ||
| disabled={disabled} | ||
| onChange={this.onChange} | ||
| aria-label={element.label} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍🏼
Just curious if label_visibility is being considered for st.metric as well?
Think proto change requires addtl sign off from Lukas, Vincent, or Tim
* develop: (25 commits) Fix CORS acronym in docstring (streamlit#5727) Add integration tests for Snowpark (streamlit#5543) Release/1.15.0 (streamlit#5720) Add audit_frontend_dependencies script to CODEOWNERS (streamlit#5708) Add label_visibility option for st.checkbox (streamlit#5705) Display existing column names in st.map exception and make st.map work with capital letters (streamlit#5679) Plotly Customization (streamlit#5681) Turn off theme for now (streamlit#5701) Add all vendored code to `make notices` (streamlit#5704) Audit frontend licenses (streamlit#5664) Surround labels in quotes (streamlit#5703) Add info about voting on features (streamlit#5660) Update issue labeling scheme to adopt new standards (streamlit#5702) Cached media (audio+video) replay (streamlit#5695) Fix docstring line wrap (streamlit#5698) Use specialized assertion functions (streamlit#5680) Release 1.14.1 (streamlit#5693) Image replay in cached functions (streamlit#5675) Add docstrings for `experimental_allow_widgets` (streamlit#5670) Remove `st.write` from `CachedStFunctionWarning` (streamlit#5669) ...
📚 Context
Add the
label_visibilitykeyword-only parameter tost.checkboxwidget, to be consistent with other widgets.What kind of change does this PR introduce?
🧠 Description of Changes
Please note that unlike other widgets
st.checkboxdoesn't useWidgetLabelcomponent for displaying widgets. That's why we have a bit different implementation for this case on the frontend side. Backend changes are identical to other widgets.Visible:

Hidden:

Collapsed:

🧪 Testing Done
🌐 References
Does this depend on other work, documents, or tickets?
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.