Skip to content

A heading deep link puts the first Tab on a TOC row #309

Description

@HMarzban

Problem

On desktop, a pad opened from a heading deep link (?h=) puts the first Tab on a TOC row, not on "Skip to main content" (#248).

The cause is a heading scrollIntoView in the TipTap chunk. scrollIntoView also moves Chrome's sequential focus navigation starting point. The same bug in useHeadingScrollSpy.ts alignTocItem was fixed by scrolling the TOC container directly.

Fix

Find the heading scrollIntoView call that runs on a ?h= load. Scroll the editor's own scroll container instead, or restore the focus starting point after the scroll.

Check

Load a pad with ?h=<heading> on desktop. The first Tab lands on "Skip to main content", and the heading is still scrolled into view.

Part of #249.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions