Skip to content

Commit

Permalink
fix: adjust workaround for android popuppanel layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Sep 24, 2024
1 parent 3d467c8 commit 72ce4eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/Popup/PopupPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ Popup.PlacementTarget is not null

ArrangeElement(child, finalFrame);

// Temporary workaround to avoid layout cycle on iOS. This block was added specifically for a bug on Android's
// MenuFlyout so, for now, we restrict to to only Android
// This can be re-evaluated and removed after https://github.com/unoplatform/uno/pull/18261 merges
#if __ANDROID__
var updatedFinalFrame = new Rect(
anchorLocation.X + (float)Popup.HorizontalOffset,
anchorLocation.Y + (float)Popup.VerticalOffset,
Expand All @@ -191,8 +195,9 @@ Popup.PlacementTarget is not null
// We re-arrange with the new updated finalFrame.
// Note: This might be a lifecycle issue, so this workaround needs to be revised in the future and deleted if possible.
// See MenuFlyoutSubItem_Placement sample.
ArrangeElement(child, updatedFinalFrame);
//ArrangeElement(child, updatedFinalFrame);
}
#endif

if (this.Log().IsEnabled(LogLevel.Debug))
{
Expand Down

0 comments on commit 72ce4eb

Please sign in to comment.