Skip to content

Commit b6b51ca

Browse files
authored
fix(dropdown): adjust icon on multiple non selection non search
Multiple, but non selection dropdowns had issues: When no values were selected, a possible long place holder was partly covered by the dropdown icon When no values are selected, the dropdown icon was completely misaligned When clearable was enabled both icons weere misaligned the search input was doubling its content while typing
1 parent 41cbbfd commit b6b51ca

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/definitions/modules/dropdown.less

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ select.ui.dropdown {
816816
.ui.dropdown:not(.selection) > .remove.icon ~ .dropdown.icon {
817817
margin-left: @clearableIconMargin;
818818
}
819-
.ui.dropdown:not(.selection) > .remove.icon {
819+
.ui.dropdown:not(.selection):not(.multiple) > .remove.icon {
820820
margin-top: -@clearableIconMarginTop;
821821
}
822822
}
@@ -879,6 +879,18 @@ select.ui.dropdown {
879879
margin: @imageLabelImageMargin;
880880
height: @imageLabelHeight;
881881
}
882+
.ui.multiple.dropdown:not(.selection):not(.labeled) {
883+
& > .dropdown.icon {
884+
right: @dropdownIconMultipleRight;
885+
}
886+
& > .remove.icon {
887+
margin-right: @dropdownIconMultipleRight;
888+
}
889+
&:not(.search) > .remove.icon ~ .text.default,
890+
> .text.default:first-child {
891+
overflow: inherit;
892+
}
893+
}
882894

883895
& when (@variationDropdownSearch) {
884896
/* -----------------
@@ -919,6 +931,13 @@ select.ui.dropdown {
919931
.ui.multiple.search.dropdown.button {
920932
min-width: @selectionMinWidth;
921933
}
934+
.ui.multiple.search.dropdown > span.sizer {
935+
display: none;
936+
}
937+
.ui.multiple.search.dropdown:not(.selection) > .remove.icon + input.search,
938+
.ui.multiple.search.dropdown:not(.selection) > input.search:first-child {
939+
min-width: @multipleSearchMinWidth;
940+
}
922941
}
923942
}
924943

src/themes/default/modules/dropdown.variables

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
@dropdownIconSize: @relative12px;
2222
@dropdownIconMargin: 0 0 0 1em;
2323
@dropdownIconMinWidth: 1em;
24+
@dropdownIconMultipleRight: -1.5em;
2425

2526
/* Current Text */
2627
@textTransition: none;
@@ -260,6 +261,8 @@
260261
@multipleSelectionChildLineHeight: @relative17px;
261262
@multipleSelectionSearchStartWidth: (@glyphWidth * 2);
262263

264+
@multipleSearchMinWidth: 5.05em;
265+
263266
/* Dropdown Icon */
264267
@multipleSelectionDropdownIconMargin: "";
265268
@multipleSelectionDropdownIconPadding: "";

0 commit comments

Comments
 (0)