Sitelet https://github.com/unoplatform/uno/pull/25032
Skip to content

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

Open
mergify[bot] wants to merge 5 commits into
servicing/6.8from
mergify/bp/servicing/6.8/pr-24947
Open

mergify[bot] wants to merge 5 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).

(cherry picked from commit 1b9aeab)

# Conflicts:
#	src/Uno.UI/UI/ViewManagement/InputPane/InputPane.cs
#	src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.OccludedPadding.cs
@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
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 conflicts Automated merge hit conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant