dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.03k stars 1.73k forks source link

Keyboard Scrolling in editors with Center or End VerticalTextAlignment is off #24977

Open tj-devel709 opened 3 hours ago

tj-devel709 commented 3 hours ago

Description

When you have a large Editor with the VerticalTextAlignment set to Center or End, both the keyboard scrolling inside KeyboardAutoManagerScroll and the MauiTextView.ShouldCenterVertically are working at the same time counterproductively to satisfy keeping the cursor above the keyboard and keeping the text aligned to the center or bottom. You'll see once the, editor's content is greater than the size of the editor, the MauiTextView.ShouldCenterVertically method will stop having effect and then just the KeyboardAutoManagerScroll will be keeping the cursor above the keyboard.

https://github.com/user-attachments/assets/50af57c0-94e9-471d-8f17-4d726ac84082

Steps to Reproduce

Video is from UITest - Issue19214_2

 <Grid RowDefinitions="50, 50, *, 50" Margin="30">
        <Entry Text="Content before" AutomationId="EntryBefore" FontSize="Large" ReturnType="Next" BackgroundColor="Aquamarine" Grid.Row="0" />
        <Label x:Name="CursorHeightTracker" Text="0" AutomationId="CursorHeightTracker" FontSize="Large" BackgroundColor="Aquamarine" Grid.Row="1" />
        <Editor x:Name="editor" AutomationId="IssueEditor" FontSize="Large" BackgroundColor="Orange" Grid.Row="2" VerticalTextAlignment="Center" TextChanged="Editor_TextChanged" />
        <Button Text="Erase" Grid.Row="3"/>
    </Grid>

Link to public reproduction project repository

No response

Version with bug

8.0.90 SR9

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 17

Did you find any workaround?

The keyboard scrolling can be disabled or the editor can be moved to a location above the keyboard

Relevant log output

No response

similar-issues-ai[bot] commented 3 hours ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.