Skip to content

Add rule to detect if initial focus is not on the first focusable element (firstFocusedElement)#52

Open
juanscasado wants to merge 2 commits intocvs-health:mainfrom
juanscasado:feature/first-focused-element-22
Open

Add rule to detect if initial focus is not on the first focusable element (firstFocusedElement)#52
juanscasado wants to merge 2 commits intocvs-health:mainfrom
juanscasado:feature/first-focused-element-22

Conversation

@juanscasado
Copy link

This PR implements the accessibility rule requested in issue #22: "First focused element".

Adds the firstFocusedElement rule to Testaro, which detects if the element initially focused when the page loads is not the first focusable element in the DOM.
Includes a validator configuration and a dedicated test page with representative cases.
Ensures results are serializable and compatible with the validation system.
Updates rule registration and validation configuration to support the new rule.
Summary of changes:

firstFocusedElement.js: New rule implementation.
firstFocusedElement.json: Validator configuration for the rule.
index.html: Test page for the rule.
testaro.js: Rule registration.
This rule helps ensure that the initial focus behavior is predictable and accessible, preventing confusion for keyboard and assistive technology users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants