cloudflare / cloudflare/react-modal2

Opt-in auto fucus

Open
#27 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
275
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Current solution when modal automatically searches for tabbable element on open sometimes leads to not desired behavior.

For instance there is a bunch of links inside modal and action button in the end. I don't want to first link be highlighted when user opens a modal.

I think any tabbable element should not be focused by default, default should be focusing on modal div itself with tabIndex='-1' (a11y-focus-scope does it now only if tabbable element can't be found).

And if you want to focus some element, then set option on react-modal2 to enable current mechanic of searching first tabbable element.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.