Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Aug 10, 2018
1 parent d7bd5b0 commit 8eb1e8b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 29 deletions.
8 changes: 8 additions & 0 deletions src-docs/src/views/form_controls/form_controls_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ export const FormControlsExample = {
type: GuideSectionTypes.HTML,
code: selectHtml,
}],
text: (
<p>
This component renders a basic HTML <code>&lt;select&gt;</code> element. If you need more customization
for how the options and/or selected values render, use the <EuiLink href="/#/forms/superselect">EuiSuperSelect</EuiLink>.
Another option is to use the <EuiLink href="/#/forms/combo-box">EuiComboBox</EuiLink>, which has search and multi-select
capabilities, but also has restrictions on how items are rendered.
</p>
),
props: {
EuiSelect,
},
Expand Down
15 changes: 6 additions & 9 deletions src-docs/src/views/super_select/super_select_basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {
Component,
Fragment,
} from 'react';

import {
Expand Down Expand Up @@ -52,14 +51,12 @@ export default class extends Component {

render() {
return (
<Fragment>
<EuiSuperSelect
options={this.options}
valueOfSelected={this.state.value}
onChange={this.onChange}
aria-label="Health levels"
/>
</Fragment>
<EuiSuperSelect
options={this.options}
valueOfSelected={this.state.value}
onChange={this.onChange}
aria-label="Health levels"
/>
);
}
}
18 changes: 8 additions & 10 deletions src-docs/src/views/super_select/super_select_complex.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,14 @@ export default class extends Component {

render() {
return (
<Fragment>
<EuiSuperSelect
options={this.options}
valueOfSelected={this.state.value}
onChange={this.onChange}
itemLayoutAlign="top"
hasDividers
aria-label="Use aria labels when no actual label is in use"
/>
</Fragment>
<EuiSuperSelect
options={this.options}
valueOfSelected={this.state.value}
onChange={this.onChange}
itemLayoutAlign="top"
hasDividers
aria-label="Use aria labels when no actual label is in use"
/>
);
}
}
10 changes: 4 additions & 6 deletions src/components/form/super_select/_super_select.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*
* 1. Make popover the same width as the form control
* 2. Style popover similar to combobox
* 3. Need specificity to override default popover styles
* 4. Use attribute selector to match popover position without needing the full popover class name
*/

.euiSuperSelect.euiPopover { /* 3 */
Expand All @@ -12,23 +14,19 @@
}
}

.euiSuperSelect__popoverPanel[class*="bottom"] {
.euiSuperSelect__popoverPanel[class*="bottom"] { /* 4 */
border-top-color: transparentize($euiBorderColor, .2);
border-top-right-radius: 0; /* 2 */
border-top-left-radius: 0; /* 2 */
}

.euiSuperSelect__popoverPanel[class*="top"] {
.euiSuperSelect__popoverPanel[class*="top"] { /* 4 */
border-bottom-color: transparentize($euiBorderColor, .2);
border-bottom-right-radius: 0; /* 2 */
border-bottom-left-radius: 0; /* 2 */
@include euiBottomShadowFlat; /* 2 */
}

.euiSuperSelect.euiPopover--anchorDownCenter.euiPopover-isOpen .euiSuperSelect__popoverPanel { /* 3 */
transform: translateX(-50%) translateY(0) translateZ(0); /* 2 */
}

.euiSuperSelect__item--hasDividers:not(:last-of-type) {
border-bottom: $euiBorderThin;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 2. Ensure the descenders don't get cut off
*/

.euiSuperSelectControl {
.euiSuperSelectControl {
@include euiFormControlStyle;
@include euiFormControlWithIcon($side: "right"); /* 1 */
@include euiFormControlIsLoading($isNextToIcon: true);
Expand Down
3 changes: 0 additions & 3 deletions src/components/form/super_select/_test.scss

This file was deleted.

0 comments on commit 8eb1e8b

Please sign in to comment.