Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove no longer required div wrapper around ValidatedDualRange #70188

Merged
merged 2 commits into from
Jun 29, 2020
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import { i18n } from '@kbn/i18n';
import React, { Component, createRef } from 'react';
import React, { Component } from 'react';
import { EuiFormRow, EuiDualRange } from '@elastic/eui';
import { EuiFormRowDisplayKeys } from '@elastic/eui/src/components/form/form_row/form_row';
import { EuiDualRangeProps } from '@elastic/eui/src/components/form/range/dual_range';
Expand Down Expand Up @@ -72,18 +72,6 @@ export class ValidatedDualRange extends Component<Props> {
return null;
}

// Can remove after eui#3412 is resolved
componentDidMount() {
if (this.trackRef.current) {
const track = this.trackRef.current.querySelector('.euiRangeTrack');
if (track) {
track.setAttribute('aria-hidden', 'true');
}
}
}

trackRef = createRef<HTMLDivElement>();

// @ts-ignore state populated by getDerivedStateFromProps
state: State = {};

Expand Down Expand Up @@ -119,34 +107,32 @@ export class ValidatedDualRange extends Component<Props> {
} = this.props;

return (
<div ref={this.trackRef}>
<EuiFormRow
<EuiFormRow
compressed={compressed}
fullWidth={fullWidth}
isInvalid={!this.state.isValid}
error={this.state.errorMessage ? [this.state.errorMessage] : []}
label={label}
display={formRowDisplay}
>
<EuiDualRange
compressed={compressed}
fullWidth={fullWidth}
isInvalid={!this.state.isValid}
error={this.state.errorMessage ? [this.state.errorMessage] : []}
label={label}
display={formRowDisplay}
>
<EuiDualRange
compressed={compressed}
fullWidth={fullWidth}
value={this.state.value}
onChange={this._onChange}
minInputProps={{
'aria-label': i18n.translate('kibana-react.dualRangeControl.minInputAriaLabel', {
defaultMessage: 'Range minimum',
}),
}}
maxInputProps={{
'aria-label': i18n.translate('kibana-react.dualRangeControl.maxInputAriaLabel', {
defaultMessage: 'Range maximum',
}),
}}
{...rest}
/>
</EuiFormRow>
</div>
value={this.state.value}
onChange={this._onChange}
minInputProps={{
'aria-label': i18n.translate('kibana-react.dualRangeControl.minInputAriaLabel', {
defaultMessage: 'Range minimum',
}),
}}
maxInputProps={{
'aria-label': i18n.translate('kibana-react.dualRangeControl.maxInputAriaLabel', {
defaultMessage: 'Range maximum',
}),
}}
{...rest}
/>
</EuiFormRow>
);
}
}