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

Add select all shortcut or button for multiselect #4714

Open
PaleNeutron opened this issue May 10, 2022 · 4 comments
Open

Add select all shortcut or button for multiselect #4714

PaleNeutron opened this issue May 10, 2022 · 4 comments
Labels
feature:st.multiselect type:enhancement Requests for feature enhancements or new features

Comments

@PaleNeutron
Copy link
Contributor

PaleNeutron commented May 10, 2022

Problem

I have about twenty options of several st.multiselect, and sometimes I need all options except only one. I want to first select all then remove one of them.

Solution

MVP: Maybe create one st.multiselect means "selected", another means "exclued", but really stupid.


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

@PaleNeutron PaleNeutron added type:enhancement Requests for feature enhancements or new features status:needs-triage Has not been triaged by the Streamlit team labels May 10, 2022
@kmcentush
Copy link

kmcentush commented May 17, 2022

For all of my use cases, I usually have blank mean "all". I just have some text tell the user that.

something like

import streamlit as st
all_options = ["a", "b", "c"]
select = st.multiselect("options (blank allows all)", all_options )

if len(select) > 0:
    temp_select = select
else:
    temp_select = all_options

# use `temp_select` instead of `select` for any filters, etc.
# etc

@lukasmasuch lukasmasuch added feature:st.multiselect and removed status:needs-triage Has not been triaged by the Streamlit team labels May 17, 2022
@PaleNeutron
Copy link
Contributor Author

@kmcentush , I did this too. But my current use case is some users want to select almost all of them.

My solution is provide two st.multiselect where the second st.multiselect means "exclued".

It is really ugly and sometimes confuse users.

@kmcentush
Copy link

For cases like that I've instead had a checkbox that makes the multiselect inclusive or exclusive rather than having two multiselects

@upasana-mittal
Copy link

This can be really useful update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.multiselect type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

5 participants