Repository navigation
fix(a11y): Don't scroll when mirroring focus to the DOM - #24605
Conversation
|
Claude finished @MartinZikmund's task in 1m 18s —— View job Review complete ✅
Verdict: ship. No inline findings posted — this is a minimal, well-targeted fix with no correctness, style, or convention issues found. What I checked:
Non-blocking observations (not filed as inline comments since they're outside this PR's disclosed scope):
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24605/wasm-skia-net9/index.html |
|
The build 235263 found UI Test snapshots differences: Details
|
morning4coffe-dev
left a comment
There was a problem hiding this comment.
LGTM! Using preventScroll: true correctly stops programmatic focus mirroring from scrolling the semantic container.
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
31214a8 to
e1296ff
Compare
|
Claude finished @MartinZikmund's task in 2m 18s —— View job Review complete ✅
Verdict: ship. No commits have changed since the prior automated review on this PR — I independently re-verified the diff against What I verified:
Non-blocking, out of scope for this PR:
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24605/wasm-skia-net9/index.html |
|
The build 235798 found UI Test snapshots differences: Details
|
e1296ff to
7731d69
Compare
|
Claude finished @MartinZikmund's task in 1m 26s —— View job Review complete ✅
Verdict: ship. No commits have changed since the prior reviews on this PR ( What I checked:
Non-blocking, out of scope for this PR (already disclosed in the PR description):
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 3
Open (3)
Callingfocus()with an options object can throw on browsers that don’t supportFocusOptions… · New Callingfocus()with an options object can throw on browsers that don’t supportFocusOptions… · New This assertion readsscrollTopimmediately afterFocus(), which can miss scroll that occurs a… · New
What changed in this PR
Prevents the browser from auto-scrolling semantic DOM containers when XAML focus is mirrored into the DOM in WASM accessibility mode, avoiding scroll feedback loops into ScrollViewer.
Changes:
- Use
element.focus({ preventScroll: true })(including the retry path) when focusing semantic DOM nodes. - Add a WASM runtime test asserting that programmatic focus does not scroll the semantic scroller or the XAML
ScrollViewer.
| File | Description |
|---|---|
| src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Automation/Given_AccessibleScrollViewer.cs | Adds a regression test ensuring semantic focus mirroring doesn’t produce browser-driven scrolling. |
| src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/Accessibility.ts | Updates semantic DOM focusing to prevent browser auto-scroll during focus mirroring. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24605/wasm-skia-net9/index.html |
|
The build 237168 found UI Test snapshots differences: Details
|
7731d69 to
a0d4363
Compare
|
Claude finished @MartinZikmund's task in 15s —— View job Review complete ✅Verdict: ship. 0 inline findings (0 blocking, 0 non-blocking). I reviewed from the PR description and the earlier automated reviews, and I did not re-read the diff or run any code in this pass. Fix
Copilot's open comments
Non-blocking, out of scope
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24605/wasm-skia-net9/index.html |
|
The build 237628 found UI Test snapshots differences: Details
|
Focusing a semantic node let the browser scroll its semantic scroller to reveal it, and the scroll listener fed that offset back into the ScrollViewer. Programmatic focus of an off-screen element then scrolled the XAML content, flaking Given_TextBox.When_GotFocus_BringIntoView on WASM once accessibility is enabled. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review feedback addressed 2026-10-09. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NHPnucPE4WuxBEhL1RJG2T
a0d4363 to
7c06b30
Compare
|
Claude finished @MartinZikmund's task in 13s —— View job Review completeVerdict: ship. 0 inline findings (0 blocking, 0 non-blocking). I re-read the TypeScript diff in this pass. I did not re-read the test file or run any code. Fix
Copilot's open comments
Out of scope
|
|
The build 238540 found UI Test snapshots differences: Details
|

GitHub Issue: closes #24604
PR Type:
🐞 Bugfix
What changed? 🚀
With accessibility enabled on WebAssembly,
Accessibility.focusSemanticElementmirrored XAML focus into the semantic DOM with a plainelement.focus(). The browser then scrolled the ScrollContentPresenter's semantic<div overflow:scroll>to reveal the focused node, and the scroll listener fed that offset back into the XAML ScrollViewer (OnScroll→ScrollContentPresenter.Set, animated). Programmatic focus in WinUI never scrolls.Both
focus()calls infocusSemanticElementnow pass{ preventScroll: true }, the same as the text-input extension. XAML stays the owner of scrolling. This path only mirrors focus that XAML already moved, and XAML does its own bring-into-view where WinUI does.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 N varying 40-457 because the scroll is caught mid-animation). It only fires in shards where earlierGiven_Accessible*tests left accessibility on. It is a separate mechanism from #24597 (scroll echoes), and both are needed: #24597 stops our own pushes from being echoed back, and this stops the browser from starting a scroll of its own.Validation
net11.0-browserwasmRelease:Given_AccessibleScrollViewer.When_Programmatic_Focus_Outside_Viewport_Then_Not_Scrolledfails without the fix (semanticscrollTop1877 instead of 0) and passes with it.Given_AccessibleScrollViewertests andWhen_GotFocus_BringIntoViewpass.scrollTop=426within 3 ms ofFocus(), andVerticalOffsetthen animated 0 → 11 → 65 → 81 throughOnScroll.Given_AccessibleScrollViewer.cs(each adds a test at the same spot).Not covered: keyboard navigation inside the semantic DOM (
SemanticElements.ts,FocusTrap.ts) also uses plain.focus(). That was found by code review only.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01WHHcu5U9N25wvKGNFCrpJm