Skip to content

Commit 97a4047

Browse files
committed
docs: Update a11y-debugging skill guide to verify focus using take_snapshot instead of evaluate_script.
1 parent 4d70d07 commit 97a4047

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

skills/a11y-debugging/SKILL.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,11 @@ The accessibility tree exposes the heading hierarchy and semantic landmarks.
5959

6060
### 4. Focus & Keyboard Navigation
6161

62-
Testing "keyboard traps" and proper focus management without visual feedback relies on precise scripting.
62+
Testing "keyboard traps" and proper focus management without visual feedback relies on tracking the focused element.
6363

64-
1. Use `evaluate_script` to find the currently focused element:
65-
```javascript
66-
() => {
67-
const active = document.activeElement;
68-
return {
69-
tag: active.tagName,
70-
id: active.id,
71-
className: active.className,
72-
text: active.innerText,
73-
};
74-
};
75-
```
76-
2. Use the `press_key` tool with `"Tab"` or `"Shift+Tab"` to move focus.
77-
3. Re-run the script in step 1 to ensure focus moved to the expected next interactive element.
64+
1. Use the `press_key` tool with `"Tab"` or `"Shift+Tab"` to move focus.
65+
2. Use `take_snapshot` to capture the updated accessibility tree.
66+
3. Locate the element marked as focused in the snapshot to verify focus moved to the expected interactive element.
7867
4. If a modal opens, focus must move into the modal and "trap" within it until closed.
7968

8069
### 5. Tap Targets and Visuals

0 commit comments

Comments
 (0)