Visitar URL original
fix(inputpane): Scroll root content above the keyboard (backport #24947) by mergify[bot] · Pull Request #25032 · unoplatform/uno · GitHub
Skip to content

fix(inputpane): Scroll root content above the keyboard (backport #24947) - #25032

Merged
ajpinedam merged 6 commits into
servicing/6.8from
mergify/bp/servicing/6.8/pr-24947
Oct 13, 2026
Merged

ajpinedam merged 6 commits into
servicing/6.8from
mergify/bp/servicing/6.8/pr-24947

Conversation

@mergify

@mergify mergify Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: related to unoplatform/kahua-private#512

PR Type:

🐞 Bugfix

What changed? 🚀

On Skia targets, a focused field could stay clipped or hidden behind the on-screen keyboard. This happened whenever the field's nearest ScrollViewer could not move it high enough, for example a details side panel whose ScrollViewer starts just above the keyboard's top edge (and worse in iPad Safari with the tab bar showing). InputPane only padded and scrolled that one ScrollContentPresenter, and nothing moved the rest of the content. In WinUI, the RootScrollViewer shrinks to the area above the input pane and scrolls the whole content instead. This PR replaces the padding with the equivalent of that RootScrollViewer. While the input pane is shown, the window's root element (RootVisual or XamlIslandRoot, through UnoRootElementLogic) acts as the outermost bring-into-view scroller, with a viewport that ends at the top of the pane. It offsets the public root visual when the focused element, padded by WinUI's 20px, still sits below that viewport, and resets the offset when the pane hides. InputPane now requests a non-animated bring-into-view, as WinUI does. Two related fixes: ScrollContentPresenter's bring-into-view used the DesiredSize-based viewport, which dropped requests coming from content stretched taller than it asks for instead of forwarding them to outer scrollers; and AutoSuggestBox now places its suggestion list in window coordinates, since the content can be offset. Given_InputPane now covers a side panel that starts near the keyboard, a field outside any ScrollViewer, focus moving while the keyboard is up, hit-testing after the content moves, restoring the content when the keyboard hides, and an app that handles Showing itself. Given_ScrollViewer covers the nested stretched-content case. Both fail without the fix. The change was also checked manually on an iPad in Safari with the SoftKeyboardFocusTests sample, whose steps are updated for the new behavior.

PR Checklist ✅


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

@mergify mergify Bot added the conflicts Automated merge hit conflicts label Oct 5, 2026
@mergify

mergify Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 1b9aeab has failed:

On branch mergify/bp/servicing/6.8/pr-24947
Your branch is ahead of 'origin/servicing/6.8' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 1b9aeab.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/Uno.UI.RuntimeTests/Tests/Windows_UI_ViewManagement/Given_InputPane.cs
	modified:   src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.cs
	modified:   src/Uno.UI/UI/Xaml/Internal/IRootElement.cs
	modified:   src/Uno.UI/UI/Xaml/Internal/Islands/XamlIslandRoot.Core.cs
	modified:   src/Uno.UI/UI/Xaml/Internal/Islands/XamlIslandRoot.uno.cs
	modified:   src/Uno.UI/UI/Xaml/Internal/RootVisual.cs
	new file:   src/Uno.UI/UI/Xaml/Internal/RootVisual.uno.cs
	modified:   src/Uno.UI/UI/Xaml/Internal/UnoRootElementLogic.cs

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   src/Uno.UI/UI/ViewManagement/InputPane/InputPane.cs
	deleted by them: src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.OccludedPadding.cs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Oct 5, 2026
@ajpinedam
ajpinedam force-pushed the mergify/bp/servicing/6.8/pr-24947 branch from a14982f to 8c6a8df Compare October 6, 2026 14:39
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Oct 6, 2026
@ajpinedam ajpinedam removed the conflicts Automated merge hit conflicts label Oct 6, 2026
@ajpinedam

Copy link
Copy Markdown
Contributor

I redid this backport by hand. Mergify's cherry-pick of 1b9aeab conflicted and committed the conflict markers in InputPane.cs, which broke every build. The five commits are now cherry-picked again (-x) onto servicing/6.8, with three differences from master that are specific to 6.8:

  • 6.8 still splits InputPane per platform, so the new root scrolling lives in InputPane.skia.cs, with a small UpdateRootViewportPartial hook in InputPane.cs. Native Android and iOS keep their current behavior.
  • ScrollContentPresenter.OccludedPadding.cs and its arrange line stay, because native Android on 6.8 still pads the ScrollViewer. On Skia they are now no-ops.
  • Given_InputPane imports Uno.UI.Toolkit.DevTools.Input, which is 6.8's namespace for the touch injection helpers.

Validated locally on 6.8: Uno.UI builds for Skia, Reference, native WASM and native Android, and Given_InputPane passes 11/11 on the Skia desktop head.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25032/wasm-skia-net9/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237683 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

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

Same skip as master (f158a6c): it fails on the iOS CI simulator
even when retried alone, unrelated to this backport.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tmiyo6fvmNeNuLXL2kbyJN
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25032/wasm-skia-net9/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237904 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

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

@ajpinedam

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25032/wasm-skia-net9/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 238542 did not find any UI Test snapshots differences.

@mergify

mergify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

@ajpinedam
ajpinedam merged commit 413cccc into servicing/6.8 Oct 13, 2026
42 of 43 checks passed
@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

backport release/stable/6.7

✅ Backports have been created

Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants