Skip to content

Commit

Permalink
Fix Issue #1256 (#1267)
Browse files Browse the repository at this point in the history
Better fix

Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com>
  • Loading branch information
cucumber-sp and VladislavAntonyuk committed Jul 3, 2023
1 parent 4ab1b51 commit 0c17bc9
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@ public static void SetSize(this MauiPopup mauiPopup, in IPopup popup)
else if (popup.Content is not null)
{
var content = popup.Content;
if (!content.Width.IsZeroOrNaN() || !content.Height.IsZeroOrNaN())
{
mauiPopup.PreferredContentSize = new CGSize(content.Width, content.Height);
}
else
{
var measure = popup.Content.Measure(double.PositiveInfinity, double.PositiveInfinity);
mauiPopup.PreferredContentSize = new CGSize(measure.Width, measure.Height);
}
var measure = popup.Content.Measure(double.PositiveInfinity, double.PositiveInfinity);
var width = content.Width.IsZeroOrNaN() ? measure.Width : content.Width;
var height = content.Height.IsZeroOrNaN() ? measure.Height : content.Height;
mauiPopup.PreferredContentSize = new CGSize(width, height);
}
}

Expand Down

0 comments on commit 0c17bc9

Please sign in to comment.