maui icon indicating copy to clipboard operation
maui copied to clipboard

iOS Keyboard Scrolling Improvements and UITests (not from fork)

Open tj-devel709 opened this issue 1 year ago • 7 comments

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

tj-devel709 avatar Sep 26 '23 21:09 tj-devel709

Any progress on this?

MalmoIt avatar Nov 09 '23 13:11 MalmoIt

Any progress on this?

Back on it now :)

tj-devel709 avatar Nov 21 '23 05:11 tj-devel709

/rebase

jsuarezruiz avatar Dec 04 '23 15:12 jsuarezruiz

Is this accessible with a nightly nuget?

andyzukunft avatar Dec 18 '23 10:12 andyzukunft

@tj-devel709 is there any progress on this PR?

NielsKnaap avatar Jan 03 '24 07:01 NielsKnaap

/azp run

tj-devel709 avatar Jan 08 '24 20:01 tj-devel709

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Jan 08 '24 20:01 azure-pipelines[bot]

/azp run

tj-devel709 avatar Jan 09 '24 21:01 tj-devel709

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Jan 09 '24 21:01 azure-pipelines[bot]

Will this make it in to the next bug fix release of Maui?

rjhind avatar Jan 13 '24 07:01 rjhind

Will this make it in to the next bug fix release of Maui?

The next one is .NET 8 Service Release 1 (SR1) and that one is IMHO finished but not yet released. So my guess is that this can be in SR2 (see).

The MAUI team can tell for sure though.

MartyIX avatar Jan 13 '24 09:01 MartyIX