Skip to content

[WASM] ScrollViewer offset reverted by semantic DOM scroll echo when accessibility is enabled #24596

Open

Description

@MartinZikmund

Current behavior 🐛

On WebAssembly (Skia) with accessibility enabled, a programmatic ScrollViewer scroll (ChangeView, BringIntoView, InputPane occlusion scroll, manipulation) is dragged back to a smaller offset shortly after it is applied.

UpdateNativeScrollOffsets mirrors the XAML offset into scrollTop/scrollLeft of the ScrollContentPresenter's semantic <div overflow:scroll>. That element's DOM scroll range comes from its semantic children, not from the XAML extent, so the browser clamps or rounds the value and raises a scroll event. The listener in Accessibility.ts forwards every scroll event to WebAssemblyAccessibility.OnScroll, which applies the clamped DOM value back to the ScrollContentPresenter, and the ScrollViewer ends up at the wrong offset.

This is also the cause of the most frequent WebAssembly runtime-test flakes on master. Once any Given_Accessible* test enables accessibility, it stays on for the rest of the shard, and later scroll tests fail. The tests fail in the full shard and pass in isolation on the CI retry:

  • Given_InputPane.When_OccludedRect_Set_Then_Focused_TextBox_Scrolled_Into_View: 16 of the last 30 master builds
  • Given_FrameworkElement_EffectiveViewport.EVP_When_NestedSV: 12/30
  • Given_InputManager.When_DirectManipulationMixedWithUIElementManipulation_Then_TopMostWinsAndChainingWorks: 10/30

Expected behavior 🎯

The ScrollViewer keeps the offset it was asked to scroll to. Only user- or assistive-technology-initiated DOM scrolls are forwarded to the ScrollViewer.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. On Skia WebAssembly, enable accessibility (e.g. WasmSemanticDomHelper.EnableAccessibilityThroughDom() in runtime tests).
  2. Put a list of focusable/semantic elements in a ScrollViewer whose extent is much larger than the semantic children's DOM extent.
  3. sv.ChangeView(null, 900, null, disableAnimation: true) and wait for idle.
  4. sv.VerticalOffset reads back ~507 instead of 900.

Runtime-test repro: run Given_AccessibleScrollViewer.When_ScrollViewer_Not_Scrollable_Then_No_Region followed by EVP_When_NestedSV; the latter fails 3/3 locally. It passes when run alone.

Workaround 🛠️

None for apps with accessibility enabled.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

WebAssembly

Uno.Sdk version (and other relevant versions) 📦

master (7.0), net11.0-browserwasm

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

Filtering the echoes fixes the revert. There is also a deeper geometry mismatch, which should be a follow-up: semantic children are positioned with TotalMatrix, which already includes the scroll offset, so scrolled content is shifted twice, and the DOM scroll range doesn't match the XAML extent. As a result, an AT-initiated DOM scroll still maps to an imprecise XAML offset.

Activity

  1. added
    kind/bug
    platform/wasm 🌐
    on Sep 23, 2026
  2. added
    7.1
    on Oct 14, 2026
  3. removed
    7.1
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugplatform/wasm 🌐

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions