Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/form/super_select/_super_select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
@include euiBottomShadowFlat; /* 2 */
}

.euiSuperSelect__item {
&:hover,
&:focus {
text-decoration: none;
background-color: $euiFocusBackgroundColor;
}
}

.euiSuperSelect__item--hasDividers:not(:last-of-type) {
border-bottom: $euiBorderThin;
}
2 changes: 2 additions & 0 deletions src/components/form/super_select/_super_select_control.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/**
* 1. Leave room for caret.
* 2. Ensure the descenders don't get cut off
* 3. Makes sure the height is correct when there's no selection
*/

.euiSuperSelectControl {
@include euiFormControlStyle;
@include euiFormControlWithIcon($side: "right"); /* 1 */
@include euiFormControlIsLoading($isNextToIcon: true);
display: block; /* 3 */
text-align: left;

line-height: $euiFormControlHeight; /* 2 */
Expand Down
24 changes: 12 additions & 12 deletions src/components/form/super_select/super_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ export class EuiSuperSelect extends Component {
null
);

// valueOfSelected is optional, and options may not exist yet
if (indexOfSelected != null) {
// wait for the CSS classes to be applied, removing visibility: hidden
requestAnimationFrame(() => {
this.focusItemAt(indexOfSelected);

this.setState({
menuWidth: this.popoverRef.getBoundingClientRect().width - 2, // account for border not inner shadow
});
requestAnimationFrame(() => {
this.setState({
menuWidth: this.popoverRef.getBoundingClientRect().width - 2, // account for border not inner shadow
});
} else {
requestAnimationFrame(focusSelected);
}

if (this.props.valueOfSelected != null) {
if (indexOfSelected != null) {
this.focusItemAt(indexOfSelected);
} else {
focusSelected();
}
}
});
};

requestAnimationFrame(focusSelected);
Expand Down