Skip to content

Commit

Permalink
[EuiComboBox] Truncate long placeholder text with ellipsis (#4210)
Browse files Browse the repository at this point in the history
  • Loading branch information
banderror authored Nov 9, 2020
1 parent d99c683 commit fd8bf9b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fixed bug in small `EuiImage`'s not respecting the optional sizes when `allowFullScreen` is set to true ([#4207](https://github.com/elastic/eui/pull/4207))
- Fixed incorrect initial rendering of `EuiDualRange` thumbs when element width is 0 ([#4230](https://github.com/elastic/eui/pull/4230))
- Fixed bug in `EuiSelectable` to call `searchProps.onChange` and `searchProps.onSearch` calls in `EuiSelectable` ([#4153](https://github.com/elastic/eui/pull/4153))
- Fixed truncation of the `EuiComboBox` `placeholder` text ([#4210](https://github.com/elastic/eui/pull/4210))

**Theme: Amsterdam**

Expand Down
10 changes: 9 additions & 1 deletion src/components/combo_box/_combo_box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* 1. Allow pills to truncate their text with an ellipsis.
* 2. Don't allow pills to overlap with the caret, loading icon or clear button.
* 2. Don't allow pills/placeholder to overlap with the caret, loading icon or clear button.
* 3. The height on combo can be larger than normal text inputs.
*/

Expand Down Expand Up @@ -51,6 +51,10 @@

&.euiComboBox__inputWrap-isLoading {
@include euiFormControlLayoutPadding(2); /* 2 */

.euiComboBoxPlaceholder {
@include euiFormControlLayoutPadding(2); /* 2 */
}
}

&.euiComboBox__inputWrap-isLoading.euiComboBox__inputWrap-isClearable {
Expand Down Expand Up @@ -121,6 +125,10 @@

&.euiComboBox__inputWrap-isLoading {
@include euiFormControlLayoutPadding(2, $compressed: true); /* 2 */

.euiComboBoxPlaceholder {
@include euiFormControlLayoutPadding(2, $compressed: true); /* 2 */
}
}

&.euiComboBox__inputWrap-isLoading.euiComboBox__inputWrap-isClearable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.euiComboBoxPlaceholder {
@include euiTextTruncate;
// Afford for the caret. The loading state is accounted for in _combo_box.scss
@include euiFormControlLayoutPadding(1, 'right');
position: absolute;
pointer-events: none;
padding: 0 $euiSizeXS;
padding-left: $euiSizeXS;
line-height: $euiSizeXL;
color: $euiColorMediumShade;
margin-bottom: 0 !important; // sass-lint:disable-line no-important
Expand Down

0 comments on commit fd8bf9b

Please sign in to comment.