You ask in plain words
With whatever notes or documents you already have.
Does keyboard focus behave properly when our pop-up dialog opens and closes?
Review this recorded keyboard trace. Opener Edit address remains available. First tab stop Address, last Save.
Your notes
Open -> Address (inside) Tab from Save -> site footer (outside) Shift+Tab from Address -> Save Escape -> closed After close -> page body
Your agent answers with a checked method
It runs 5 checks before it replies.
Your agentUsing this skill
Forward Tab escapes from Save to the site footer. Make it wrap to Address and restore focus to Edit address after Escape closes the dialog. Retest both transitions. Entry, reverse wrap and Escape itself were observed working.
- Checking only Tab misses reverse traversal leaking into the background.
- Moving focus to the body after a dialog closes can leave a keyboard user stranded even when closing itself works.
- Closing the dialog with a mouse click during testing hides keyboard problems. Close it by keyboard, by Escape and by any Cancel or Close button.
- aria-modal="true" on a dialog that does not actually block the page behind can hide that content from screen-reader users while keyboard users can still reach it. W3C advises marking a dialog modal only when it behaves as one.
- A native dialog opened with showModal() makes the page behind inert and returns focus to the previously focused element when it closes; a custom dialog has to do both in script. Do not assume a custom dialog behaves like the native one.
Why that’s right. Forward traversal escapes the dialog and focus is lost after closing. Reverse traversal is independently correct.
Is it the right skill?
What it’s for, and when another skill or a person is the better choice.
Use it when
- Someone has tested a modal dialog with the keyboard and wants to know whether the focus behaviour is right.
- Keyboard users report that focus disappears behind a pop-up, gets lost after closing it or jumps to the top of the page.
- A team is comparing a native dialog element with a custom modal and wants one test to run on both.
Not the right skill when
- Non-modal pop-ups, menus, tooltips or disclosure panels. They do not contain focus, so these checks do not apply; use the pattern for that component.
- How a screen reader announces the dialog's role, name and description. That needs a separate screen-reader test.
- Focus order and visible focus across the whole page. Those are WCAG 2.4.3 and 2.4.7 checks for every component.
The method it follows
7 steps, in order, every time.
- Open the dialog from its control by keyboard. Check that focus moves to an element inside it: usually the first focusable control, or a heading or static element at the start (made focusable with tabindex="-1") when the content needs reading first. Entry fails if focus stays on the page behind.
- From the last tabbable element, press Tab: focus should move to the first tabbable element in the dialog. From the first, press Shift+Tab: focus should move to the last. Record the two directions as separate results.
- If Tab or Shift+Tab reaches anything on the page behind the dialog, that wrap fails. Focus passing through the browser's own toolbar before returning to the dialog is acceptable under WCAG 2.4.3, which W3C notes for modal dialogs; record it as a difference from the APG pattern, not as a leak.
- Press Escape and check that the dialog closes. If it does not, note whether another keyboard route such as a Close button works: with no keyboard way out at all, WCAG 2.1.2 No Keyboard Trap fails.
- Check where focus lands after closing: normally the control that opened the dialog. If that control no longer exists, or the design names a logical next step, focus should be on that element. Focus on the page body, the top of the page or nowhere visible is a failure.
- Mark each transition that was not observed as untested, including return when closing was never observed. Markup such as aria-modal="true" or the open attribute does not show focus behaviour; only the trace does.
- For each failure give the fix and repeat the same keystrokes to confirm it. Leaks into the page and lost return focus relate to WCAG 2.4.3 Focus Order.
What to have ready
If something’s missing, your agent asks before it starts.
- The opening control, dialog contents in tab order, and an observed trace for open, Tab, Shift+Tab, Escape and the return destination.
- Any documented logical successor if the opener disappears or the workflow continues somewhere new.

Which control opens the dialog, and does it still exist after the dialog closes? This decides where focus should return.

Which are the first and last tabbable elements inside the dialog? The wrap checks are judged at those boundaries.

Is there a designed destination for focus when the dialog finishes, such as the next row after deleting one? W3C allows a logical successor when the opener has gone or the workflow moves on.

Which transitions were actually observed, and in which browser? Anything not observed stays untested.
Try it on your own AI
A new question with a known answer, so you can check your AI gets it right.
-
Copy the questionReview a delete-row dialog. Opener belongs to removed row. The design specifies the next row selector as the logical successor. First stop Cancel, last Delete. Return only JSON following the skill’s test format. Open -> dialog heading (inside, programmatically focusable) Tab from Delete -> Cancel Reverse traversal was not observed Escape -> closed during a separate cancellation run After confirmed deletion -> next row selector
-
Ask your AI in a new chat
Give it this skill first, then paste the question. It replies with a short block of data in the format the skill asks for.
-
Show the answer and why
Initial focus may land on a heading, and the documented successor is appropriate after deletion. The reverse wrap needs observation.
{
"failed": [],
"untested": [
"reverse-wrap"
]
}
The check runs in your browser. Nothing you paste is sent anywhere.
Where the method comes from
Free to use and adapt with credit (CC BY 4.0).
Use this skill in Raq.com
Add it to your Skill Library and your agent applies it whenever a request matches. Edit it for your own business and keep every version.