Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mayagbarnes
Copy link
Collaborator

@mayagbarnes mayagbarnes commented Jun 10, 2025

Describe your changes

Add a maxHeight & overflow scroll specification to st.multiselect

GitHub Issue Link (if applicable)

Closes #9085
Closes #8671

Testing Plan

  • E2E Tests: Updated ✅
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Jun 10, 2025
@snyk-io
Copy link
Contributor

snyk-io bot commented Jun 10, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 10, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-11577/streamlit-1.45.1-py3-none-any.whl
🕹️ Preview app pr-11577.streamlit.app (☁️ Deploy here if not accessible)

@mayagbarnes mayagbarnes marked this pull request as ready for review June 10, 2025 08:49
},
ControlContainer: {
style: {
maxHeight: "10.25rem",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Do you think this will work well with the potential future work of height params with Advanced Layouts? I suppose if we were to introduce such an API, this would become the default maxHeight, and any overrides from the user could take precedence, but wanted to hear your thoughts on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this could be easily adapted for a potential height param, as you noted would just have user-specified height take precedence over this default maxHeight, but still makes sense to me to have some default (in this case 4 options tall).

Also, currently working on tweaking this from a hard-coded value to a calculated value in rem based on baseFontSize & padding values to better integrate with adv theming 👍🏼

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated - since the margin/padding on the multiselect options is fixed px vs. rem like I thought, opted for a px calc factoring in baseFontSize. This can also be adapted in future to just return the element's height value, which we usually pass as an int.

@mayagbarnes mayagbarnes merged commit 2dde36c into develop Jun 12, 2025
37 checks passed
@mayagbarnes mayagbarnes deleted the fix-9085 branch June 12, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Papercut: multiselect should have a max height st.multiselect is too high when multiple options are selected

3 participants