Skip to content

Commit

Permalink
fix(dropdown): adjust icon on multiple non selection non search
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lubber-de authored Mar 1, 2023
1 parent 41cbbfd commit b6b51ca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/definitions/modules/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ select.ui.dropdown {
.ui.dropdown:not(.selection) > .remove.icon ~ .dropdown.icon {
margin-left: @clearableIconMargin;
}
.ui.dropdown:not(.selection) > .remove.icon {
.ui.dropdown:not(.selection):not(.multiple) > .remove.icon {
margin-top: -@clearableIconMarginTop;
}
}
Expand Down Expand Up @@ -879,6 +879,18 @@ select.ui.dropdown {
margin: @imageLabelImageMargin;
height: @imageLabelHeight;
}
.ui.multiple.dropdown:not(.selection):not(.labeled) {
& > .dropdown.icon {
right: @dropdownIconMultipleRight;
}
& > .remove.icon {
margin-right: @dropdownIconMultipleRight;
}
&:not(.search) > .remove.icon ~ .text.default,
> .text.default:first-child {
overflow: inherit;
}
}

& when (@variationDropdownSearch) {
/* -----------------
Expand Down Expand Up @@ -919,6 +931,13 @@ select.ui.dropdown {
.ui.multiple.search.dropdown.button {
min-width: @selectionMinWidth;
}
.ui.multiple.search.dropdown > span.sizer {
display: none;
}
.ui.multiple.search.dropdown:not(.selection) > .remove.icon + input.search,
.ui.multiple.search.dropdown:not(.selection) > input.search:first-child {
min-width: @multipleSearchMinWidth;
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/themes/default/modules/dropdown.variables
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@dropdownIconSize: @relative12px;
@dropdownIconMargin: 0 0 0 1em;
@dropdownIconMinWidth: 1em;
@dropdownIconMultipleRight: -1.5em;

/* Current Text */
@textTransition: none;
Expand Down Expand Up @@ -260,6 +261,8 @@
@multipleSelectionChildLineHeight: @relative17px;
@multipleSelectionSearchStartWidth: (@glyphWidth * 2);

@multipleSearchMinWidth: 5.05em;

/* Dropdown Icon */
@multipleSelectionDropdownIconMargin: "";
@multipleSelectionDropdownIconPadding: "";
Expand Down

0 comments on commit b6b51ca

Please sign in to comment.