Bug 251003 - Scroll-snap snaps to wrong element after VoiceOver navigation
Summary: Scroll-snap snaps to wrong element after VoiceOver navigation
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad Unspecified
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-23 03:19 PST by Johannes Odland
Modified: 2024-04-03 02:49 PDT (History)
4 users (show)

See Also:


Attachments
A video of the bug (662.37 KB, video/mp4)
2023-01-23 03:19 PST, Johannes Odland
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Odland 2023-01-23 03:19:17 PST
Created attachment 464607 [details]
A video of the bug

Found another bug that might be related to https://bugs.webkit.org/show_bug.cgi?id=250999

When using VoiceOver to navigate (swipe right gesture) a page with scroll-snap on :root, the wrong element will sometimes snap to the viewport.
I have tried to recreate a minimal example here: https://codepen.io/johannesodland/pen/QWBQQoM

(The example must be tested in debug mode / full screen. It does not work if run in an iframe. )

Expected result: 
After using VoiceOver to navigate to an element, that element should stay in the viewport.

Actual result: 
After using VoiceOver to navigate to an element, then a different element snaps to the viewport effectively pushing the element with VoiceOver focus out of the viewport.

This breaks navigation for the user. If they use touch navigation from here they will reach content on another part of the page, and not where they navigated to.



Observations: 
- It is sometimes possible to see the element with VoiceOver focus being scrolled into the viewport in one frame, before it disappears and another element is snapped into place.
- I have experienced VoiceOver navigation breaking down after seeing this bug, similar to https://bugs.webkit.org/show_bug.cgi?id=250999. 

I have marked this bug with `Severity: Major` as this affects Accessibility / VoiceOver navigation. Feel free to adjust the severity as fit.
Comment 1 Radar WebKit Bug Importer 2023-01-23 03:19:33 PST
<rdar://problem/104549964>
Comment 2 Johannes Odland 2023-01-23 23:49:41 PST
Might be related to https://bugs.webkit.org/show_bug.cgi?id=245722 where scrollIntoView fails after the browser interface has retracted.
Comment 3 Johannes Odland 2023-03-27 22:54:25 PDT
Retested on iOS Safari 16.4. The issue still persists. 

I have moved the test case to a new location for easier testing. 
Here is the URL: https://johannesodland.github.io/browserbugs/safari-scroll-snap-voice-over-snaps-to-wrong-element-issue.html
Comment 4 Johannes Odland 2023-05-22 04:29:09 PDT
Retested on iOS 16.5
The issue is still present.
Comment 5 Johannes Odland 2023-09-19 09:25:55 PDT
Retested on iOS 17. 
Still snaps to wrong element, with the correct element ending up outside the viewport.
Comment 6 Johannes Odland 2024-03-07 12:16:07 PST
Retested in iOS 17.4. Some of the focused elements still end up outside the viewport.