Skip to content

Commit

Permalink
remove no longer required div wrapper around ValidatedDualRange
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jun 29, 2020
1 parent 3571100 commit c781302
Showing 1 changed file with 24 additions and 38 deletions.
Original file line number Diff line number Diff line change
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>
);
}
}

0 comments on commit c781302

Please sign in to comment.