fix(inputpane): Scroll root content above the keyboard (backport #24947) - #25032
Open
mergify[bot] wants to merge 5 commits into
Open
mergify[bot] wants to merge 5 commits into
mergify[bot] wants to merge 5 commits into
Conversation
(cherry picked from commit d494f86)
(cherry picked from commit 1b9aeab) # Conflicts: # src/Uno.UI/UI/ViewManagement/InputPane/InputPane.cs # src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.OccludedPadding.cs
(cherry picked from commit 4cb4ca3)
(cherry picked from commit d272124)
(cherry picked from commit 0b61c7f)
Contributor
Author
|
Cherry-pick of 1b9aeab has failed: 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 |
2 of 5 tasks
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: 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
ScrollViewercould not move it high enough, for example a details side panel whoseScrollViewerstarts just above the keyboard's top edge (and worse in iPad Safari with the tab bar showing).InputPaneonly padded and scrolled that oneScrollContentPresenter, and nothing moved the rest of the content. In WinUI, theRootScrollViewershrinks to the area above the input pane and scrolls the whole content instead. This PR replaces the padding with the equivalent of thatRootScrollViewer. While the input pane is shown, the window's root element (RootVisualorXamlIslandRoot, throughUnoRootElementLogic) 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.InputPanenow requests a non-animated bring-into-view, as WinUI does. Two related fixes:ScrollContentPresenter's bring-into-view used theDesiredSize-based viewport, which dropped requests coming from content stretched taller than it asks for instead of forwarding them to outer scrollers; andAutoSuggestBoxnow places its suggestion list in window coordinates, since the content can be offset.Given_InputPanenow covers a side panel that starts near the keyboard, a field outside anyScrollViewer, focus moving while the keyboard is up, hit-testing after the content moves, restoring the content when the keyboard hides, and an app that handlesShowingitself.Given_ScrollViewercovers the nested stretched-content case. Both fail without the fix. The change was also checked manually on an iPad in Safari with theSoftKeyboardFocusTestssample, whose steps are updated for the new behavior.PR Checklist ✅
Screenshots Compare Test Runresults.This is an automatic backport of pull request #24947 done by [Mergify](https://mergify.com).