Skip to content

Commit 4732674

Browse files
committed
Fix CSS text wrapping for single selects
Select2 previously had an issue displaying the text of long values as it was not correctly wrapping the text. This was because the browser did not know that it couldn't wrap at whitespace, which has been fixed. Now Select2 should properly display an ellipsis for large text values instead of overflowing. This closes select2#2984.
1 parent 0c0e252 commit 4732674

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

dist/css/select2.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
-webkit-user-select: none; }
1414
.select2-container .select2-selection--single .select2-selection__rendered {
1515
display: block;
16-
overflow: hidden;
1716
padding-left: 8px;
1817
padding-right: 20px;
19-
text-overflow: ellipsis; }
18+
overflow: hidden;
19+
text-overflow: ellipsis;
20+
white-space: nowrap; }
2021
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
2122
padding-right: 8px;
2223
padding-left: 20px; }

0 commit comments

Comments
 (0)