sveltejs / sveltejs/kit

Body autofocus on route-change does not bring screen-reader (VO) to top if clicked-link is still on page

Open
#10,374 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

router
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

When I use VoiceOver to navigate via a link that remains on the page after the route-change, then that link remains selected by VoiceOver (even though the page-title is correctly announced and keyboard-tabbing correctly starts from the top of the page).

Here is a video demonstrating this behavior (from this site: https://sveltekit-sr-focus-demo.vercel.app/):

https://github.com/sveltejs/kit/assets/44578578/edc49d9b-ed1e-4879-81ac-392768d45958

Reproduction

https://github.com/MichaelAllenWarner/sveltekit-sr-focus-demo

I started with a "skeleton" project via CLI, and added the bare minimum to reproduce the behavior. In case it helps, here is the diff with that extra bare minimum: https://github.com/MichaelAllenWarner/sveltekit-sr-focus-demo/commit/bf783a4b8df158ba7a2dd107cd1c2578b3754a8e

Logs

No response

System Info
System:
    OS: macOS 13.3
    CPU: (12) arm64 Apple M2 Pro
    Memory: 39.48 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.8.1 - ~/.nvm/versions/node/v19.8.1/bin/node
    npm: 9.6.2 - ~/.nvm/versions/node/v19.8.1/bin/npm
  Browsers:
    Chrome: 114.0.5735.198
    Edge: 114.0.1823.43
    Safari: 16.4
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0
    @sveltejs/kit: ^1.20.4 => 1.22.3
    svelte: ^4.0.5 => 4.0.5
    vite: ^4.4.2 => 4.4.3
Severity

annoyance

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked sveltekit-sr-focus-demo reproduction with VoiceOver and comparing route changes where the clicked link remains on the page. Trace the body autofocus behavior during navigation and verify the fix by confirming VoiceOver moves to the top while keyboard tabbing still starts there.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.