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.04k stars 1.73k forks source link

iOS Editor cursor above keyboard location can be inconsistent #24635

Open tj-devel709 opened 1 month ago

tj-devel709 commented 1 month ago

Description

After this PR lands, iOS Editors can now keep the cursor above the keyboard when new lines are added. However, there is a small bug where the cursor location can be a little higher than most scenarios, and I am not sure why.

I've found this to happen when the bottom line is empty and we click and scroll the line above that last empty line. If the bottom line is not empty, this does not occur. I haven't noticed this occurring in other scenarios. In the video I attach here, it does happen in the middle in a seemingly different scenario, but I did not close and open the keyboard before so that would be worth looking into more. I have checked the ContentInset, TextContainerInset, ContentOffsets, and CursorRects in these scenarios and they all seem to be consistent whether the bottom line has text or not.

https://github.com/user-attachments/assets/41391678-34c1-4bea-b115-39821b85d152

Steps to Reproduce

Place a long Editor on a MAUI app on an iPhone. By adding new lines, you should see the cursor stay above the keyboard. However, if you add two blank new lines at the very end of this editor, click the second to last line, and keep adding new lines, you should see the cursor stays even higher above the keyboard than with other lines.

Link to public reproduction project repository

No response

Version with bug

Unknown/Other

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 17.2

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.