Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, aligns with the described regression, and is backed by targeted Skia runtime tests covering both the regression scenario and the opt-out path.
Pull request overview
This PR fixes a Skia InputPane keyboard-occlusion regression where applying the occlusion pad reduced the layout viewport and unintentionally re-arranged viewport-sized content (e.g., centered sign-in cards). The ScrollContentPresenter now arranges content against the un-occluded height so the occlusion pad contributes to scrollable extent rather than shifting viewport-sized layouts.
Changes:
- Update
ScrollContentPresenter.ArrangeOverrideto add back the occlusion-pad height when computing the child arrange rect height. - Add Skia runtime coverage to ensure centered (non-occluded) content doesn’t move when occlusion padding is applied, and to validate the
EnsuredFocusedElementInViewopt-out path.
File summaries
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.cs | Arrange content using finalSize.Height + _occludedRectPadding.Bottom so occlusion padding increases extent instead of reflowing viewport-sized layouts. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_ViewManagement/Given_InputPane.cs | Add runtime tests covering “non-occluded centered content stays put” and the app opt-out (EnsuredFocusedElementInView) behavior on Skia. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 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-24410/wasm-skia-net9/index.html |
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral change is narrowly scoped, aligns with the described regression, and is backed by targeted Skia runtime tests covering both the regression and the bring-into-view contract.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24410/wasm-skia-net9/index.html |
|
The build 232171 found UI Test snapshots differences: Details
|
|
|
|
@Mergifyio backport servicing/6.8 |
✅ Backports have been createdDetails
|
|
@Mergifyio backport release/stable/6.7 |
✅ Backports have been createdDetails
|
…r-24410 fix(skia): Keep keyboard occlusion pad out of the content arrange (backport #24410)
…6.7/pr-24410 fix(skia): Keep keyboard occlusion pad out of the content arrange (backport #24410)
GitHub Issue: closes #24409
PR Type:
🐞 Bugfix
What changed? 🚀
When the soft keyboard opens,
InputPanepads the nearest constrainedScrollContentPresenterby the full keyboard overlap, so that the minimalBringIntoViewwhich follows lands the focused element flush above the input pane. That padding shrinks the layout viewport, so content that sizes itself to the viewport gets re-arranged into the smaller box: a sign-in card centered in aGridinside a full-windowScrollViewerjumps up by half the keyboard height even when the focused field was never occluded, and the area behind the keyboard is squeezed out of the content instead of becoming scrollable.The presenter now arranges its content against the un-occluded height:
The viewport still shrinks — that is what makes
BringIntoViewstop above the keyboard — but the pad turns into scrollable extent rather than moving viewport-sized content. It is a strict no-op whenever no occlusion pad is applied (_occludedRectPadding.Bottom == 0), i.e. whenever the keyboard is down.This is the regression half of 6f6bd62 (
fix(skia): Fix keyboard occlusion scroll padding, in 6.7.103). That commit correctly replaced a pad that was never large enough to move a genuinely occluded field; this PR keeps that behavior and removes the layout side effect it introduced.Measured on Skia Desktop (viewport 768, occlusion 307.2):
Validation
Given_InputPane.When_Focused_Element_Not_Occluded_Then_Centered_Content_Is_Not_Moved, verified fail-before / pass-after onmaster(fails with "Centered card moved by 153.5px although nothing was occluded", passes with the fix). It waits for the pad to actually be applied before asserting, so it cannot pass vacuously, and it also asserts that the extent grows by the occlusion and that the viewport still shrinks.Given_InputPane.When_App_Ensured_Focused_Element_In_View_Then_No_Pad_Is_Applied, covering the WinUI opt-out (InputPaneVisibilityEventArgs.EnsuredFocusedElementInView) on the same code path.Given_InputPane.When_Occluded_Field_In_Viewport_Sized_Content_Then_Scrolled_Above_Occlusion, guarding the bring-into-view contract in the geometry this change actually alters: content that sizes itself to the viewport with the focused field behind the keyboard. It passes both before and after by design — before, the field was squeezed above the keyboard by the shrunken arrange; after, the scroll does the work — which is the point: the guarantee holds either way. The two pre-existing occlusion tests use content ~2040px tall, where this change is a mathematical no-op (desiredalready exceedsviewport + pad), so they could not have shown this.Given_InputPanetests (the 6f6bd62 coverage) still pass — the occluded-field bring-into-view behavior is unchanged.Given_ScrollViewer/Given_ScrollViewer_Zoomruntime tests pass (4 skipped), plus 33ScrollViewerTests.Given_ScrollViewer_Anchoring/_ScrollChaining.master.Reported by a customer on 6.7.103; a backport to
release/stable/6.7should follow once this merges, where the same change was validated on the branch directly.PR Checklist ✅
Screenshots Compare Test Runresults.