maui
maui copied to clipboard
iOS Keyboard Scrolling Improvements and UITests (not from fork)
Description of Change
Note: recreating this PR from a branch not in my fork for sake of UITests Issue.
Grid with Star Row Resizing
When there is a grid at the top-level of the content page, and there is at least one star-sized row, the grid would resize when the keyboard came up. This was due to safe-area of the grid on the bottom no longer needing to size down for the bottom SafeAreaInset since the grid was raised higher than the bottom of the device. To handle this, logic was added so that we can call the scrolling code again after the grid (or other view) expands.
Grid with Star Row Resizing Example (click me!)
Before | After |
---|---|
<Grid RowDefinitions="40,*,40,40, 40">
<Button Grid.Row="0" Background="blue" Text="Print CollectionView Height"/>
<TableView Background="lightblue" x:Name="ColView" Grid.Row="1"/>
<Button Grid.Row="2" Background="blue" Text="Print CollectionView Height"/>
<Editor
x:Name="myEditor"
Grid.Row="3"
BackgroundColor="MediumSeaGreen"
Placeholder="Send Chat"
PlaceholderColor="White"
TextColor="White"/>
<Button Grid.Row="4" Text="Fill collection"/>
</Grid>
Scrolling animation glitch
There was a small glitch in the scrolling animation. While we are computing the animation speed the keyboard will use to come up, the screen would sometimes scroll a little after it making it a tad jumpy. Since we no longer need the automatic delay in the AdjustPositionDebounce
method since the cursor location logic is moved to later in the process, I found that this delay was causing the small jump in the animation.
Scrolling animation glitch Example (click me!)
After |
---|
Next Return Key fix
When we have an entry with the ReturnType of 'Next' and we press that next button to go into an editor, the editor would sometimes not come up high enough. This was due to the additional AccessoryView that is added to the keyboard for editors in Maui. When we hit this scenario of switching between an editor and entry, we should recalculate to see if the keyboard changed sizes.
UITests
Testing the iOS Keyboard scenarios is difficult as there are many different scenarios. I created some UITests that can help keep track of the verification that scrolling is happening correctly.
It is important to note that most of the iOS Scrolling UITests are run with four different configurations:
- Using iOS Large Titles with a scrollable page
- Not using iOS Large Titles with a scrollable page
- Using iOS Large Titles with a non-scrollable page
- Not using iOS Large Titles with a non-scrollable page
Example of the Large Titles and Small Titles respectively (click me!)
Large Titles | Small Titles |
---|---|
Testing multiple editors in different locations (click me!)
https://github.com/dotnet/maui/assets/50846373/7a76b9a7-3b5d-4575-8b96-3b3524bd20b0
Testing multiple entries in different locations (click me!)
https://github.com/dotnet/maui/assets/50846373/09fa1966-f7dd-4392-b56f-5408e9816e5e
Testing entry next button to editor (click me!)
https://github.com/dotnet/maui/assets/50846373/1191659d-a4a3-4aba-9bb7-6894b6656dba
Testing grid with star row resizing (click me!)
https://github.com/dotnet/maui/assets/50846373/2d9f1354-8d83-4c1b-a508-7fdabe0db391
Issues Fixed
Fixes #17588 Fixes #17559 Fixes #18354 Fixes #19245
Any progress on this?
Any progress on this?
Back on it now :)
/rebase
Is this accessible with a nightly nuget?
@tj-devel709 is there any progress on this PR?
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Will this make it in to the next bug fix release of Maui?