Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Controls/src/Core/Shapes/Shape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ protected override Size MeasureOverride(double widthConstraint, double heightCon
break;

case Stretch.Fill:
if (!double.IsInfinity(heightConstraint))
if (!double.IsInfinity(heightConstraint) || HeightRequest > 0)
{
result.Height = heightConstraint;
result.Height = HeightRequest < 0 ? heightConstraint : HeightRequest;
}

if (!double.IsInfinity(widthConstraint))
if (!double.IsInfinity(widthConstraint) || WidthRequest > 0)
{
result.Width = widthConstraint;
result.Width = WidthRequest < 0 ? widthConstraint : WidthRequest;
}
break;

Expand Down
104 changes: 104 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue26877.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using Microsoft.Maui.Controls.Shapes;

namespace Controls.TestCases.HostApp.Issues;
[Issue(IssueTracker.Github, 26877, "The iOS platform page cannot scroll to the bottom", PlatformAffected.iOS)]
public class Issue26877 : ContentPage
{
public Issue26877()
{
var scrollView = new ScrollView
{
BackgroundColor = Colors.AliceBlue
};

var stackLayout = new StackLayout();
stackLayout.Children.Add(new Label
{
Text = "ScrollToBottomPage",
TextColor = Colors.Black,
AutomationId = "ScrollToBottomPage"
});

stackLayout.Children.Add(new RoundRectangle
{
BackgroundColor = Colors.Red,
HeightRequest = 100,
});

stackLayout.Children.Add(new Rectangle
{
BackgroundColor = Colors.Azure,
HeightRequest = 100
});

stackLayout.Children.Add(new Ellipse
{
BackgroundColor = Colors.BlanchedAlmond,
HeightRequest = 100
});

stackLayout.Children.Add(new RoundRectangle
{
BackgroundColor = Colors.Red,
HeightRequest = 100,
});

stackLayout.Children.Add(new Rectangle
{
BackgroundColor = Colors.Azure,
HeightRequest = 100
});

stackLayout.Children.Add(new Ellipse
{
BackgroundColor = Colors.BlanchedAlmond,
HeightRequest = 100
});

stackLayout.Children.Add(new RoundRectangle
{
BackgroundColor = Colors.Red,
HeightRequest = 100,
});

stackLayout.Children.Add(new Rectangle
{
BackgroundColor = Colors.Azure,
HeightRequest = 100
});

stackLayout.Children.Add(new Ellipse
{
BackgroundColor = Colors.BlanchedAlmond,
HeightRequest = 100
});

stackLayout.Children.Add(new RoundRectangle
{
BackgroundColor = Colors.Red,
HeightRequest = 100,
});

stackLayout.Children.Add(new Rectangle
{
BackgroundColor = Colors.Azure,
HeightRequest = 100
});

stackLayout.Children.Add(new Ellipse
{
BackgroundColor = Colors.BlanchedAlmond,
HeightRequest = 100
});

stackLayout.Children.Add(new Label
{
Text = "2. The test passes if you were able to scroll down to this message.",
TextColor = Colors.Black,
AutomationId = "Label"
});

scrollView.Content = stackLayout;
Content = scrollView;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Tests.Issues;

public class Issue26877 : _IssuesUITest
{
public Issue26877(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "The iOS platform page cannot scroll to the bottom";

[Test]
[Category(UITestCategories.Shape)]
[Category(UITestCategories.ScrollView)]
public void ScrollToBottom()
{
App.WaitForElement("ScrollToBottomPage");
App.ScrollTo("Label");
App.WaitForElement("Label");
}
}
Loading