Repository navigation
fix(skia): Keep keyboard occlusion pad out of the content arrange (backport #24410) - #24418
Merged
Merged
Conversation
ajpinedam
approved these changes
Sep 5, 2026
Contributor
|
/azp run |
3 of 5 tasks
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24418/wasm-skia-net9/index.html |
Contributor
|
|
Contributor
Author
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.This is an automatic backport of pull request #24410 done by [Mergify](https://mergify.com).