Fix popup dialog potentially not clicking last button when dismissed

This commit is contained in:
Joseph Madamba 2022-05-04 09:27:53 -07:00
parent bc839be4d8
commit 21e1f4546a
1 changed files with 1 additions and 5 deletions

View File

@ -100,10 +100,6 @@ public IEnumerable<PopupDialogButton> Buttons
}
}
// We always want dialogs to show their appear animation, so we request they start hidden.
// Normally this would not be required, but is here due to the manual Show() call that occurs before LoadComplete().
protected override bool StartHidden => true;
protected PopupDialog()
{
RelativeSizeAxes = Axes.Both;
@ -272,7 +268,7 @@ protected override void PopIn()
protected override void PopOut()
{
if (!actionInvoked && content.IsPresent)
if (!actionInvoked)
// In the case a user did not choose an action before a hide was triggered, press the last button.
// This is presumed to always be a sane default "cancel" action.
buttonsContainer.Last().TriggerClick();