[Webkit-unassigned] [Bug 272624] New: Using <main tabindex=-1> does not maintain scroll position when returning to the page

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 13 01:50:16 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=272624

            Bug ID: 272624
           Summary: Using <main tabindex=-1> does not maintain scroll
                    position when returning to the page
           Product: WebKit
           Version: Safari 17
          Hardware: iPhone / iPad
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Accessibility
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: dan at danburzo.ro
                CC: andresg_22 at apple.com,
                    webkit-bug-importer at group.apple.com

Created attachment 470911

  --> https://bugs.webkit.org/attachment.cgi?id=470911&action=review

A test-case using <main tabindex=-1>

A web page using `<main tabindex=-1>` for its main content area (a common markup pattern for „Skip to content” links) loses its scroll position on iOS Safari when navigating away from the page, then tapping the Back button. The scroll position is moved to the top of the `<main>` element.

This seems related to the fact that focus (as evidenced by document.activeElement) returns to the `<main>` element, which may cause the browser to scroll it into view.

This only happens on iOS Safari, macOS Safari works well.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240413/b8fd1a59/attachment-0001.htm>


More information about the webkit-unassigned mailing list