diff --git a/CHANGELOG.md b/CHANGELOG.md index 97b9c03e478..df28558e7aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `16.2.0`. +**Bug fixes** + +- Fixed label wrapping of `EuiSwitch` ([#2585](https://github.com/elastic/eui/pull/2585)) +- Replaced `

` tag surrounding the label with a `` tag in `EuiSwitch` to fix any inherited margin ([#2585](https://github.com/elastic/eui/pull/2585)) +- Add the same padding from `EuiSelectableListItem` to the heading to fix alignment ([#2585](https://github.com/elastic/eui/pull/2585)) ## [`16.2.0`](https://github.com/elastic/eui/tree/v16.2.0) - Added `EuiCheckableCard` component, for radio buttons or checkboxes with complex child content ([#2555](https://github.com/elastic/eui/pull/2555)) -- Updated `EuiCheckbox` and `EuiCheckboxGroup` to TypeScript. ([#2555](https://github.com/elastic/eui/pull/2555)) +- Updated `EuiCheckbox` and `EuiCheckboxGroup` to TypeScript ([#2555](https://github.com/elastic/eui/pull/2555)) **Bug fixes** diff --git a/src-docs/src/components/guide_locale_selector/guide_locale_selector.js b/src-docs/src/components/guide_locale_selector/guide_locale_selector.js index a065b054bbd..2f9bef49516 100644 --- a/src-docs/src/components/guide_locale_selector/guide_locale_selector.js +++ b/src-docs/src/components/guide_locale_selector/guide_locale_selector.js @@ -19,7 +19,7 @@ import { EuiSwitch, EuiFormRow } from '../../../../src/components'; export const GuideLocaleSelector = ({ selectedLocale, onToggleLocale }) => { return ( - + - + {}} /> - + - + - + { this.setState({ isPopoverOpen: false }); @@ -87,6 +88,7 @@ export class DisplayToggles extends Component { {(canDisabled || canIsDisabled) && ( @@ -98,6 +100,7 @@ export class DisplayToggles extends Component { {canReadOnly && ( @@ -109,6 +112,7 @@ export class DisplayToggles extends Component { {canLoading && ( @@ -120,6 +124,7 @@ export class DisplayToggles extends Component { {canInvalid && ( @@ -131,6 +136,7 @@ export class DisplayToggles extends Component { {canFullWidth && ( @@ -142,6 +148,7 @@ export class DisplayToggles extends Component { {canCompressed && ( compressed{' '} @@ -162,6 +169,7 @@ export class DisplayToggles extends Component { {canPrepend && ( @@ -173,6 +181,7 @@ export class DisplayToggles extends Component { {canAppend && ( diff --git a/src-docs/src/views/form_controls/file_picker.js b/src-docs/src/views/form_controls/file_picker.js index d57ee542bf3..5b482f7fe54 100644 --- a/src-docs/src/views/form_controls/file_picker.js +++ b/src-docs/src/views/form_controls/file_picker.js @@ -54,6 +54,7 @@ export class FilePicker extends Component { canReadOnly={false} extras={[ { diff --git a/src-docs/src/views/form_layouts/described_form_group.js b/src-docs/src/views/form_layouts/described_form_group.js index bd2d65c9928..58c3abe07d1 100644 --- a/src-docs/src/views/form_layouts/described_form_group.js +++ b/src-docs/src/views/form_layouts/described_form_group.js @@ -158,6 +158,7 @@ export default class extends Component { fullWidth> - + -

Label -

+ `; @@ -91,11 +91,11 @@ exports[`EuiSwitch is rendered 1`] = ` -

Label -

+ `; diff --git a/src/components/form/switch/_switch.scss b/src/components/form/switch/_switch.scss index 800938ae35b..94c10570c6f 100644 --- a/src/components/form/switch/_switch.scss +++ b/src/components/form/switch/_switch.scss @@ -1,6 +1,7 @@ .euiSwitch { position: relative; - display: inline-block; + display: inline-flex; + align-items: flex-start; min-height: $euiSwitchHeight; .euiSwitch__label { @@ -13,6 +14,7 @@ } .euiSwitch__button { + flex-shrink: 0; // ensures the button doesn't lose width because of a long label line-height: 0; // ensures button takes height of switch inside &:focus .euiSwitch__thumb { diff --git a/src/components/form/switch/switch.tsx b/src/components/form/switch/switch.tsx index 5798ee4c99d..d4e806f6574 100644 --- a/src/components/form/switch/switch.tsx +++ b/src/components/form/switch/switch.tsx @@ -112,9 +112,9 @@ export const EuiSwitch: FunctionComponent = ({ //