forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Multiselect label truncation in narrow columns (streamlit#9334)
## Describe your changes This fixes some visual behavior seen in the Multiselect component, specifically: 1. Labels have a max-width so they don't overflow when they are longer than their parent containers 2. When truncated, the label text is truncated (rather than being cut off) 3. When truncated, the label's `x` button will be visible (rather than being cut off) 4. When truncated with only 1 option, the Multiselect does't grow to multiple lines Before: <img width="205" alt="Screenshot 2024-08-26 at 9 35 31 AM" src="https://github.com/user-attachments/assets/76ad0bc7-0031-4595-8a03-3abf0cfa98cc"> After: <img width="191" alt="Screenshot 2024-08-23 at 4 06 49 PM" src="https://github.com/user-attachments/assets/95ecc3b6-1227-4ea3-b85a-a2a705de5226"> ## GitHub Issue Link (if applicable) streamlit#8213 ## Testing Plan - This adds Snapshot tests for this scenario --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
- Loading branch information
1 parent
4f1b7ef
commit 9cb6e48
Showing
12 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
Binary file added
BIN
+2.61 KB
...napshots__/linux/st_multiselect_test/st_multiselect-11[dark_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.14 KB
...snapshots__/linux/st_multiselect_test/st_multiselect-11[dark_theme-firefox].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.69 KB
..._snapshots__/linux/st_multiselect_test/st_multiselect-11[dark_theme-webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.5 KB
...apshots__/linux/st_multiselect_test/st_multiselect-11[light_theme-chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.05 KB
...napshots__/linux/st_multiselect_test/st_multiselect-11[light_theme-firefox].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.62 KB
...snapshots__/linux/st_multiselect_test/st_multiselect-11[light_theme-webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.49 KB
..._/linux/st_multiselect_test/st_multiselect-dropdown_narrow_column[chromium].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.05 KB
...__/linux/st_multiselect_test/st_multiselect-dropdown_narrow_column[firefox].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.62 KB
...s__/linux/st_multiselect_test/st_multiselect-dropdown_narrow_column[webkit].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters