Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updates page load focus management #4740

Merged
merged 9 commits into from
Nov 28, 2024
Merged

chore: updates page load focus management #4740

merged 9 commits into from
Nov 28, 2024

Conversation

thiessenp-cds
Copy link
Contributor

@thiessenp-cds thiessenp-cds commented Nov 28, 2024

Summary | Résumé

Fixes an issue where on a "page" load an AT user may first have an input focussed (perhaps by an AT or *) and a prompt about typing in the text field. Then our code would focus the first heading. So the user would think they could start typing but unexpectedly be on a heading.

The fix updates the focus element function to first check for a visible input element and focus that. If none are available then fallback to a passed in selector, probably a heading, if none is passed or the previous fails, just try to focus the main heading (h1). If there is no H1, then we have bigger problems :)

Test

Open a form with groups (pages). One of the pages should have two or more form controls (input, textarea, select). When the page that is a groups page loads, the first form control should be focussed. Your cursor should be in the first input. (or on another page without an input on the first heading)

Peter can test on Windows + Edge + Jaws.

@thiessenp-cds thiessenp-cds linked an issue Nov 28, 2024 that may be closed by this pull request
Copy link
Contributor

@thiessenp-cds thiessenp-cds marked this pull request as ready for review November 28, 2024 17:17
@thiessenp-cds thiessenp-cds merged commit 0b9ff2c into main Nov 28, 2024
13 checks passed
@thiessenp-cds thiessenp-cds deleted the fix/4690 branch November 28, 2024 19:32
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.

Accessibility: heading landmark causing confusion
2 participants