st.multiselect
with max_selections
argument does not return "No Results" when search does not match any option, but shows the max selection message
#7116
Labels
feature:st.multiselect
priority:P2
status:confirmed
Bug has been confirmed by the Streamlit team
type:bug
Something isn't working
Checklist
Summary
When searching in a multiselect widget and the search does not match any of the available options, the dropdown continues to show "You can only select up to N options. Remove an option first." This behavior is inconsistent with the selectbox widget's functionality when the search has no matching options and causes confusion for end users who are searching for an option, but instead are told to remove options.
Reproducible Code Example
Steps To Reproduce
Scenario 1 - no selected options were made yet
max_selections
argument set to value of 1 (however this applies to other integer values above zero)Scenario 2 - selected options are less than the
max_selections
argumentmax_selections
argument set to value of 2 (however this applies to other integer values above zero)Expected Behavior
When no selections are made in the multiselect widget, I expect the dropdown to show "No Results" when searching, and no search matches occur.
When options are selected in the multiselect widget, but less than
max_selections
, I expect the dropdown to show "No Results" when searching, and no search matches occur.When the person has selected the number of options equal to the
max_selections
argument, I expect the dropdown to show "You can only select up to N options. Remove an option first." and not be able to search in the multiselect widget.Current Behavior
Scenario 1
Scenario 2
Is this a regression?
Debug info
Additional Information
Maybe related to these pull requests
The text was updated successfully, but these errors were encountered: