Repository navigation
React Modal keyboard recipe with an intentionally wrong return target #1085
PerchAnton
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I made a React Modal 3.16.3 consumer using
setAppElement,contentLabel,aria.modal, and the component's normal focus handling.Source and reproduction commands compares a short native Playwright test with a KeyTrail contract for an Edit profile form. It checks keyboard entry, initial focus on the modal, forward/reverse order, Escape and return to the trigger. The contract passes. A deliberately wrong return target produces a failed
FOCUS_MISMATCHreport, which is kept as the negative control.The development and production examples pass locally on Chrome 157/macOS ARM with React 19.3.1 and no retries. The report is attached as JSON to Playwright's HTML output. This covers the fixture, not every React Modal option, screen reader or browser.
I maintain KeyTrail. Its extra value here is a reusable contract and first-failure report; the native test is enough for a simpler opening/closing requirement. This is an external recipe, not a request for React Modal to add a dependency.
All reactions