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.26k stars 1.76k forks source link

Editor and ScrollView problems in iOS #22946

Open geertgeerits opened 5 months ago

geertgeerits commented 5 months ago

Description

  1. Editor: HorizontalOptions does not work.
  2. ScrollView: Orientation="Vertical": The orientation is wrong when the device is rotated from landscape to portrait. The orientation is changed to horizontal.

Steps to Reproduce

Open the repository and click the 'Click me' button.

Link to public reproduction project repository

https://github.com/geertgeerits/MauiBugEditor

Version with bug

8.0.21 SR4.1

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 tested from version 15

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 5 months 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.

Zhanglirong-Winnie commented 5 months ago

Verified this issue with Visual Studio 17.11.0 Preview 1.1 (8.0.40&8.0.21). Can repro on iOS platform with sample project.

karthikraja-arumugam commented 1 month ago

Issue 1: Since the parent grid is set to center alignment, the editor is aligned according to its size. If you want the editor to occupy the entire width, set the grid's horizontal options to "Fill" so the editor can take up the available space.

    <Grid
        RowDefinitions="Auto, *, Auto"
        ColumnDefinitions="130*, 100, 130*, 1"
        HorizontalOptions="Fill"
        Margin="0,0,4,5">

       ...
</Grid>

Issue 2: There doesn't appear to be any issue when changing device orientation at runtime. Could you please provide additional details, such as a screenshot or video, for better clarity on the issue?

geertgeerits commented 1 month ago

HorizontalOptions="Center" to HorizontalOptions="Fill" makes no difference. The error remains. Tested on an iPad with iOS 17.7. See images on the project repository. It works correct on Android and Windows.

karthikraja-arumugam commented 1 month ago

Yes @geertgeerits, I missed some code. We need to set the horizontal option for the inner grid. The screenshot below shows the resulting output.

image (1)

If we set the horizontal options for both grids, the output will look like this.

image (2)
geertgeerits commented 1 month ago

The first problem is solved with that but not the second. When you press the 'Click me' key in vertical position you see the full text. Turn the device to horizontal position and then back to vertical position then you notice that the text is not displayed completely. On the iPad the text is lost after OOOOOO-P. So the letters P, Q, R, S, T are not displayed.

karthikraja-arumugam commented 3 weeks ago

@geertgeerits, The issue with horizontal scrolling has been resolved in the latest .NET 9 package. Could you please verify this with .NET 9?

geertgeerits commented 3 weeks ago

Hi, The error is still there: ScrollView: Orientation="Vertical": The orientation is wrong when the device is rotated from landscape to portrait. The orientation is changed to horizontal. When entering a text (click the 'Click me' button) in portrait position, then turn the device to landscape position and then back to portrait position, you wil see that there is text missing. Link to public reproduction project repository: https://github.com/geertgeerits/MauiBugEditor See screenshots on the repository: IMG_5471-Portrait before.PNG - IMG_5472-Landscape.PNG - IMG_5473-Portrait after.PNG I think it has to do with the HorizontalOptions property of the editor.

Visual Studio 2022 Preview: version 17.12.0 Preview 5.0 Microsoft.Maui.Controls: version 9.0.0-rc.2.24503.2 Microsoft.Maui.Controls.Compatibility: version 9.0.0-rc.2.24503.2