Accessible360 / accessible-slick

the last (accessible) carousel you'll ever need.
https://accessible360.github.io/accessible-slick
MIT License
254 stars 45 forks source link

Role & ARIA-label persist on carousel after 'unslicking' #93

Open SirDaev opened 1 year ago

SirDaev commented 1 year ago

When an accessible-slick slider becomes 'unslicked' (via the responsive settings or via jQuery), the role and aria-label that are appended upon 'slicking' persist. This makes for excess attributes that a screen reader will read out when the carousel no longer exists. The role and aria-label should be removed upon destroying the slider.

Minimal demo showing persisting attributes: https://codepen.io/SirDaev/pen/KKrdoPz

Before (when carousel is initialized): Screen Shot 2023-06-15 at 10 58 06 AM

After (when carousel is destroyed via unslick): Screen Shot 2023-06-15 at 10 57 22 AM