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

Added aria-hidden to EuiRangeSlider and EuiRangeTrack #3423

Merged
merged 10 commits into from
May 7, 2020
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `aria-hidden = true` to `EuiRangeSlider` and `EuiRangeTrack` if `showInput = true` ([#3423](https://github.com/elastic/eui/pull/3423))
- Added `iconType` prop to `EuiDatePicker` ([#3383](https://github.com/elastic/eui/pull/3383))
- Applied `max-width: 100%` to `EuiPageBody` so inner flex-based items don't overflow their containers ([#3375](https://github.com/elastic/eui/pull/3375))
- Added `titleSize` prop to `EuiStep` and `EuiSteps` ([#3340](https://github.com/elastic/eui/pull/3340))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports[`renders EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -124,6 +125,7 @@ exports[`renders compressed EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -235,6 +237,7 @@ exports[`renders disabled EuiColorStops 1`] = `
Test: Disabled. Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack euiRangeTrack--disabled"
>
<div
Expand Down Expand Up @@ -349,6 +352,7 @@ exports[`renders empty EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -385,6 +389,7 @@ exports[`renders fixed stop EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -496,6 +501,7 @@ exports[`renders free-range EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -532,6 +538,7 @@ exports[`renders fullWidth EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -643,6 +650,7 @@ exports[`renders max-only EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -679,6 +687,7 @@ exports[`renders min-only EuiColorStops 1`] = `
Test: Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -715,6 +724,7 @@ exports[`renders readOnly EuiColorStops 1`] = `
Test: Read-only. Color stop picker. Each stop consists of a number and corresponding color value. Use the Down and Up arrow keys to select individual stops. Press the Enter key to create a new stop.
</p>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down
13 changes: 13 additions & 0 deletions src/components/form/range/__snapshots__/dual_range.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`EuiDualRange allows value prop to accept empty strings 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
Expand Down Expand Up @@ -35,6 +36,7 @@ exports[`EuiDualRange allows value prop to accept numbers 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -89,6 +91,7 @@ exports[`EuiDualRange input props can be applied to min and max inputs 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="true"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -144,6 +147,7 @@ exports[`EuiDualRange is rendered 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -182,6 +186,7 @@ exports[`EuiDualRange props compressed should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -217,6 +222,7 @@ exports[`EuiDualRange props custom ticks should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
style="margin-right:0.6em"
>
Expand Down Expand Up @@ -277,6 +283,7 @@ exports[`EuiDualRange props disabled should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack euiRangeTrack--disabled"
>
<div
Expand Down Expand Up @@ -313,6 +320,7 @@ exports[`EuiDualRange props fullWidth should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -367,6 +375,7 @@ exports[`EuiDualRange props inputs should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="true"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -429,6 +438,7 @@ exports[`EuiDualRange props labels should render 1`] = `
0
</label>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -469,6 +479,7 @@ exports[`EuiDualRange props levels should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -516,6 +527,7 @@ exports[`EuiDualRange props range should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand Down Expand Up @@ -601,6 +613,7 @@ exports[`EuiDualRange props ticks should render 1`] = `
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
style="margin-right:0.6em"
>
Expand Down
26 changes: 26 additions & 0 deletions src/components/form/range/__snapshots__/range.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ exports[`EuiRange allows value prop to accept a number 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
class="euiRangeSlider"
id="generated-id"
max="100"
Expand Down Expand Up @@ -38,9 +40,11 @@ exports[`EuiRange allows value prop to accept empty string 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
class="euiRangeSlider"
id="generated-id"
max="100"
Expand All @@ -61,9 +65,11 @@ exports[`EuiRange is rendered 1`] = `
class="euiRangeWrapper euiRange testClass1 testClass2"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
aria-label="aria-label"
class="euiRangeSlider"
data-test-subj="test subject string"
Expand All @@ -87,9 +93,11 @@ exports[`EuiRange props compressed should render 1`] = `
class="euiRangeWrapper euiRangeWrapper--compressed euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
class="euiRangeSlider euiRangeSlider--compressed"
id="generated-id"
max="100"
Expand All @@ -110,6 +118,7 @@ exports[`EuiRange props custom ticks should render 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
style="margin-right:0.6em"
>
Expand Down Expand Up @@ -138,6 +147,7 @@ exports[`EuiRange props custom ticks should render 1`] = `
</button>
</div>
<input
aria-hidden="false"
class="euiRangeSlider euiRangeSlider--hasTicks"
id="generated-id"
max="100"
Expand All @@ -158,9 +168,11 @@ exports[`EuiRange props disabled should render 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack euiRangeTrack--disabled"
>
<input
aria-hidden="false"
class="euiRangeSlider"
disabled=""
id="generated-id"
Expand All @@ -182,9 +194,11 @@ exports[`EuiRange props fullWidth should render 1`] = `
class="euiRangeWrapper euiRangeWrapper--fullWidth euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
class="euiRangeSlider"
id="generated-id"
max="100"
Expand All @@ -205,9 +219,11 @@ exports[`EuiRange props input should render 1`] = `
class="euiRangeWrapper euiRange testClass1 testClass2"
>
<div
aria-hidden="true"
class="euiRangeTrack"
>
<input
aria-hidden="true"
aria-label="aria-label"
class="euiRangeSlider"
data-test-subj="test subject string"
Expand Down Expand Up @@ -257,9 +273,11 @@ exports[`EuiRange props labels should render 1`] = `
0
</label>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
class="euiRangeSlider"
id="generated-id"
max="100"
Expand All @@ -285,6 +303,7 @@ exports[`EuiRange props levels should render 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand All @@ -300,6 +319,7 @@ exports[`EuiRange props levels should render 1`] = `
/>
</div>
<input
aria-hidden="false"
class="euiRangeSlider"
id="generated-id"
max="100"
Expand All @@ -320,6 +340,7 @@ exports[`EuiRange props range should render 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<div
Expand All @@ -331,6 +352,7 @@ exports[`EuiRange props range should render 1`] = `
/>
</div>
<input
aria-hidden="false"
class="euiRangeSlider euiRangeSlider--hasRange"
id="generated-id"
max="100"
Expand Down Expand Up @@ -384,6 +406,7 @@ exports[`EuiRange props ticks should render 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
style="margin-right:0.6em"
>
Expand Down Expand Up @@ -447,6 +470,7 @@ exports[`EuiRange props ticks should render 1`] = `
</button>
</div>
<input
aria-hidden="false"
class="euiRangeSlider euiRangeSlider--hasTicks"
id="generated-id"
max="100"
Expand All @@ -467,9 +491,11 @@ exports[`EuiRange props value should render 1`] = `
class="euiRangeWrapper euiRange"
>
<div
aria-hidden="false"
class="euiRangeTrack"
>
<input
aria-hidden="false"
class="euiRangeSlider"
id="generated-id"
max="100"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`EuiRangeTrack is rendered 1`] = `
<div
aria-hidden="false"
class="euiRangeTrack"
style="margin-right:0.6em"
>
Expand Down
4 changes: 3 additions & 1 deletion src/components/form/range/dual_range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ export class EuiDualRange extends Component<EuiDualRangeProps> {
ticks={ticks}
levels={levels}
onChange={this.handleSliderChange}
value={value}>
value={value}
showInput={showInput}>
{showRange && this.isValid && (
<EuiRangeHighlight
compressed={compressed}
Expand Down Expand Up @@ -585,6 +586,7 @@ export class EuiDualRange extends Component<EuiDualRangeProps> {
showRange={showRange}
onFocus={onFocus}
onBlur={onBlur}
showInput={showInput}
{...rest}
/>

Expand Down
Loading