Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI. Auto-sized Grid row containing ScrollView containing a Rectangle ignores explicit HeightRequest on the Rectangle. #15086

Open
Keflon opened this issue May 15, 2023 · 4 comments
Labels
area-controls-scrollview ScrollView platform/iOS 🍎 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@Keflon
Copy link

Keflon commented May 15, 2023

Description

Given the following xaml:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiGridScrollBug2.MainPage">
    
    <Grid RowDefinitions="*,*">
        <ScrollView Grid.Row="0">
            <Rectangle HeightRequest="600" BackgroundColor="Blue"/>
        </ScrollView>
        <ScrollView Grid.Row="1">
            <Rectangle HeightRequest="600" BackgroundColor="Yellow"/>
        </ScrollView>
    </Grid>

</ContentPage>

Expected result is 2 grid rows each with a Rectangle that can be scrolled up and down.

image

Actual result for WinUI - the Rectangle instances are minimal height.

image

Steps to Reproduce

  1. Create a File->New MAUI app.
  2. Replace the MainPage.xaml content with this:
<Grid RowDefinitions="*,*">
    <ScrollView Grid.Row="0">
        <Rectangle HeightRequest="600" BackgroundColor="Blue"/>
    </ScrollView>
    <ScrollView Grid.Row="1">
        <Rectangle HeightRequest="600" BackgroundColor="Yellow"/>
    </ScrollView>
</Grid>
  1. Remove the click-handler in MainPage.xaml.cs
  2. Run the WinUI app.

Link to public reproduction project repository

https://github.com/Keflon/MauiGridScrollBug2

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Latest

Did you find any workaround?

No response

Relevant log output

No response

@rmarinho
Copy link
Member

Did you try other controls inside of the ScrollCiew instead of a Shape? Like a label with HeightRequest?

@rmarinho rmarinho added this to the Backlog milestone May 15, 2023
@ghost
Copy link

ghost commented May 15, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@Keflon
Copy link
Author

Keflon commented May 15, 2023

Did you try other controls inside of the ScrollCiew instead of a Shape? Like a label with HeightRequest?

Button and Label instances work as expected. Both were tried with same HeightRequest of 600.

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 15, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 11, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Windows 11 and iOS 16.4, not repro on Android 13.0-API33 with below Project:
MauiGridScrollBug2.zip

@Eilon Eilon removed the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView platform/iOS 🍎 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants