Skip to content

Commit

Permalink
Merge pull request #6638 from amwx/FlyoutOpeningFix
Browse files Browse the repository at this point in the history
FlyoutBase create presenter before calling Opening event
  • Loading branch information
maxkatz6 authored and grokys committed Sep 29, 2021
1 parent 3ca9fab commit fdb6cc2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Avalonia.Controls/Flyouts/FlyoutBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,6 @@ protected virtual bool ShowAtCore(Control placementTarget, bool showAtPointer =
}
}

if (CancelOpening())
{
return false;
}

if (Popup.Parent != null && Popup.Parent != placementTarget)
{
((ISetLogicalParent)Popup).SetParent(null);
Expand All @@ -236,6 +231,11 @@ protected virtual bool ShowAtCore(Control placementTarget, bool showAtPointer =
Popup.Child = CreatePresenter();
}

if (CancelOpening())
{
return false;
}

PositionPopup(showAtPointer);
IsOpen = Popup.IsOpen = true;
OnOpened();
Expand Down

0 comments on commit fdb6cc2

Please sign in to comment.