Skip to content

Commit aa46004

Browse files
committed
NEXT-33675 - Patch tiny-slider package to optionally disable the aria-live attributes
1 parent 3bea48a commit aa46004

9 files changed

+813
-86
lines changed

.allowed-licenses

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ MPL-2.0
2020
Python-2.0
2121
Unlicense
2222
WTFPL
23+
Public Domain
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Remove unwanted aria-live attributes from sliders
3+
issue: NEXT-33675
4+
---
5+
# Storefront
6+
* Added NPM dependency `patch-package` to allow patches of NPM packages.
7+
___
8+
# Upgrade Information
9+
## Added new `ariaLive` option to Storefront sliders
10+
By default, all Storefront sliders/carousels (`GallerySliderPlugin`, `BaseSliderPlugin`, `ProductSliderPlugin`) are adding an `aria-live` region to announce slider updates to a screen reader.
11+
12+
In some cases this can worsen the accessibility, for example when a slider uses "auto slide" functionality. With automatic slide the slider updates can disturb the reading of other contents on the page.
13+
14+
You can now deactivate the `aria-live` region on the slider plugins with the new option `ariaLive` (default: `true`).
15+
16+
Example for `GallerySliderPlugin` (Also works for `BaseSliderPlugin` and `ProductSliderPlugin`)
17+
```diff
18+
{% set gallerySliderOptions = {
19+
slider: {
20+
+ ariaLive: false,
21+
autoHeight: false,
22+
},
23+
thumbnailSlider: {
24+
+ ariaLive: false,
25+
controls: true,
26+
responsive: {}
27+
}
28+
} %}
29+
30+
<div data-gallery-slider-options='{{ gallerySliderOptions|json_encode }}'>
31+
```
32+
33+
When `ariaLive` is `false` it will omit the `aria-live` region in the generated `tiny-slider` HTML code:
34+
```diff
35+
<div class="tns-outer" id="tns3-ow">
36+
- <div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">
37+
- slide <span class="current">2</span> of 6
38+
- </div>
39+
<div id="tns3-mw" class="tns-ovh">
40+
<!-- Slider contents -->
41+
</div>
42+
</div>
43+
```

0 commit comments

Comments
 (0)