You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[WASM] Programmatic focus scrolls the ScrollViewer when accessibility is enabled #24604
On WebAssembly (Skia) with accessibility enabled, programmatically focusing an element that is outside a ScrollViewer's viewport scrolls the ScrollViewer. In WinUI, programmatic focus never scrolls.
Accessibility.focusSemanticElement mirrors XAML focus to the semantic DOM with element.focus(), without { preventScroll: true }. The browser then scrolls the ScrollContentPresenter's semantic <div overflow:scroll> to reveal the node, and the scroll listener forwards that DOM offset to WebAssemblyAccessibility.OnScroll → ScrollContentPresenter.Set. The XAML ScrollViewer scrolls, animated.
This is the cause of the WASM flake Given_TextBox.When_GotFocus_BringIntoView (5 of the last 30 master builds; Expected:<0>. Actual:<N> with varying N, since the scroll is caught mid-animation). It only shows up in shards where earlier Given_Accessible* tests have left accessibility on.
Expected behavior 🎯
Mirroring focus to the semantic DOM does not scroll anything. Scrolling stays owned by XAML, like the text-input extension, which already passes preventScroll: true.
How to reproduce it (as minimally and precisely as possible) 🔬
Enable accessibility on Skia WebAssembly.
Put a focusable control below the viewport of a ScrollViewer.
Call control.Focus(FocusState.Programmatic).
The ScrollViewer's VerticalOffset animates away from 0.
Workaround 🛠️
None when accessibility is enabled.
Renderer 🎨
Skia
Native
Affected platforms 📱💻🖥️
WebAssembly
Uno.Sdk version (and other relevant versions) 📦
master (7.0)
IDE version 🧑💻
No response
Anything else we need to know? 💬
Related to #24596 (semantic scroll echoes fed back to the ScrollViewer). Keyboard navigation inside the semantic DOM (SemanticElements.ts, FocusTrap.ts) also calls plain .focus(). That was found by code review only and is not covered here.
Activity