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

Don't change the focus of the page on initial load #244

Merged
merged 5 commits into from
Jul 16, 2021

Conversation

colinbm
Copy link
Contributor

@colinbm colinbm commented Jul 9, 2021

⚠️ Don't forget to update the gem version in the CHANGELOG before merging! When you're ready to release bump version file and generate a tag. ⚠️

What

On loading a page initially foo.html do not change the URL to foo.html#h1-id until scrolling past.
Remove the fragment from the navigation for the h1.

Why

It is expected that focus will begin at the start of the page. Changing this is confusing for screen reader users.

On page load the main page heading is automatically focused. This may be navigationally disorientating for users reliant on the use of the keyboard alone to navigate.

Keyboard only user comments:
“When this page loads, focus starts in the content of the page. I found this confusing as I expected my focus to start at the top of the page.”

Solution:
Users would expect to navigate the page in reading order, from top to bottom and left to right.

Note

I'm not sure about the navigation change... in itself it's not confusing as the target fragment is clear in the clicked link, but it still seems like the link to the "page" rather than "position on page" should be at the beginning. I'm going to double check this with DAC, but welcome any thoughts. Confirmed this is correct approach with DAC.

colinbm added 2 commits July 9, 2021 08:13
When clicking a nav link that is the main entry point for the page, the
focus should start at the very beginning. There is the "Skip to main content"
link to allow the user to bypass the nav.

Some nav examples do not include a page, for in page navigation. In this
case the fragment remains at level 1.
@colinbm colinbm requested a review from 36degrees July 9, 2021 13:03
@colinbm colinbm force-pushed the accessibility-initial-focus branch from 4059f62 to bb70a4a Compare July 14, 2021 13:14
Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@colinbm colinbm merged commit fe79973 into master Jul 16, 2021
@colinbm colinbm deleted the accessibility-initial-focus branch July 16, 2021 11:29
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