FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3k stars 596 forks source link

fix: only add tabIndex when keyboardControls enabled #984

Closed parkersweb closed 1 year ago

parkersweb commented 1 year ago

Description

Prevents tabIndex=0 being added to slider-frame when keyboard controls are not enabled. This fixes an accessibility issue whereby the slider-frame was previously focussable even though it was non-interactive when enableKeyboardControls=false.

Not sure if this requires additional tests?

Fixes #982

Type of Change

How Has This Been Tested?

Verified in nextJs sample app that the tabindex=0 attribute is only present when enableKeyboardControls=true.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nuka-carousel ✅ Ready (Inspect) Visit Preview Nov 15, 2022 at 8:40AM (UTC)
fritz-c commented 1 year ago

Also, there's this item from the PR template checklist that you skipped:

I have recorded any user-facing fixes or changes with pnpm changeset.

That will help us make the next release with your changes.

parkersweb commented 1 year ago

thanks @fritz-c - should be done now!