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
3.07k stars 595 forks source link

Dynamically setting disabled state results in keyboard focus getting lost #1045

Open Chudesnov opened 8 months ago

Chudesnov commented 8 months ago

Is there an existing issue for this?

Code of Conduct

Code Sandbox link

https://commerce.nearform.com/open-source/nuka-carousel/

Bug report

Default navigation mode relies on disabling prev/next buttons in DOM when user reaches the first / last slide.

Dynamically setting HTML disabled on a focused element results in keyboard focus getting lost. The recommended way of managing disabled state for such widgets is using tabIndex={-1} and aria-disabled="true" instead, which doesn't affect keyboard focus.

Workarounds