Skip to content

fix(skia): Keep keyboard occlusion pad out of the content arrange (backport #24410) - #24456

Merged
agneszitte merged 2 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-24410
Sep 11, 2026
Merged

agneszitte merged 2 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-24410

Conversation

@mergify

@mergify mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #24409

PR Type:

🐞 Bugfix

What changed? 🚀

When the soft keyboard opens, InputPane pads the nearest constrained ScrollContentPresenter by the full keyboard overlap, so that the minimal BringIntoView which 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 a Grid inside a full-window ScrollViewer jumps 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:

childRect.Height = Math.Max(finalSize.Height + _occludedRectPadding.Bottom, desiredSize.Height);

The viewport still shrinks — that is what makes BringIntoView stop 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):

pad bottom viewport extent card top
before this PR 307.2 461 461 284 → 130.5
after this PR 307.2 461 768 284 → 284

Validation

  • New runtime test Given_InputPane.When_Focused_Element_Not_Occluded_Then_Centered_Content_Is_Not_Moved, verified fail-before / pass-after on master (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.
  • New runtime test 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.
  • New runtime test 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 (desired already exceeds viewport + pad), so they could not have shown this.
  • The three existing Given_InputPane tests (the 6f6bd62 coverage) still pass — the occluded-field bring-into-view behavior is unchanged.
  • Regression sweep: all 55 Given_ScrollViewer / Given_ScrollViewer_Zoom runtime tests pass (4 skipped), plus 33 ScrollViewerTests.Given_ScrollViewer_Anchoring / _ScrollChaining.
  • All runs on the Skia Desktop head (macOS) against master.

Reported by a customer on 6.7.103; a backport to release/stable/6.7 should follow once this merges, where the same change was validated on the branch directly.

PR Checklist ✅


This is an automatic backport of pull request #24410 done by [Mergify](https://mergify.com).

@agneszitte

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 233011 has failed on Uno.UI - CI.

@agneszitte
agneszitte merged commit 8a3a655 into release/stable/6.7 Sep 11, 2026
14 of 24 checks passed
@agneszitte
agneszitte deleted the mergify/bp/release/stable/6.7/pr-24410 branch September 11, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants