sveltejs / sveltejs/kit

Set the sequential focus navigation starting point without location.replace

Open
#16,982 0 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

reset_focus sets the sequential focus navigation starting point with location.replace('#id') (client.js:3792 at 2eed63867), then undoes the side effects: the popstate it fires, the nulled history.state, and the scroll. It still leaks a hashchange to app listeners.

Giving the target tabindex="-1", calling focus({ preventScroll: true, focusVisible: false }) and removing the attribute sets the starting point in all three engines with none of those side effects. It was option 1 in #10856, passed over for the focus ring, which focusVisible now removes.

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 at reset_focus in client.js:3792 and read the discussion of option 1 in issue #10856. Verify the focus-starting behavior across the relevant browser engines, then confirm that the change avoids popstate, history.state, scrolling, and hashchange side effects while preserving focus-ring behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.