KEMBAR78
ScrollView inside a Grid expands width past device screen when rotated · Issue #27715 · dotnet/maui · GitHub
Skip to content

ScrollView inside a Grid expands width past device screen when rotated #27715

@tj-devel709

Description

@tj-devel709

Description

In the parent issue, it is pointed out that the imageButton that has HorizontalOptions="End" is not seen on the screen when the device is rotated.

This led me to do some digging, and I noticed that when the screen is rotated, the ScrollView inside the grid will just expand horizontally to the content even when the ScrollView is set to Orientation="Vertical". This is the incorrect behavior as the grid should just have the bounds of the device's screen.

For example, in the images below, when there are 3 projects and that project card section does not expand past the screen horizontally, the imagebutton below it is visible. However, when I add a 4th project that goes beyond the screen's width, the imagebutton is pushed further right and is not visible.

Image

Image

The issue occurs in 9.0.21. When using 9.0.50, the scrollview still expands horizontally, but there is a scrollbar to scroll vertically and horizontally. This makes the scenario a little better, but this is still not the desired and expected behavior.

I also tested Android and this seems to only be an issue with iOS.

Note:
I also noticed that if I remove the outer Grid, then this is not an issue when I rotate the screen.
Also, this happens when isolating other elements too other than the project cards that I wouldn't really expect to need to take up more room. Notice that you cannot see the clean up button to the right of the "Tasks" heading in the images below:

Image

Image

Steps to Reproduce

  1. Run the DeveloperBalance App: https://github.com/dotnet/maui-samples/tree/main/9.0/Apps/DeveloperBalance.
  2. Deploy to an iOS device.
  3. Rotate the first page - MainPage and observe the behavior of the grid expanding horizontally.

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/9.0/Apps/DeveloperBalance

Version with bug

9.0.30 SR3

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

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions