diff --git a/src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs b/src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs index b089bc0f8d..538e9d53b2 100644 --- a/src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs +++ b/src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs @@ -101,10 +101,11 @@ public async Task CloseAsync(PopupResult result, CancellationToken token = defau protected override bool OnBackButtonPressed() { - // Only close the Popup if CanBeDismissedByTappingOutsideOfPopup is true - if (GetCanBeDismissedByTappingOutsideOfPopup(popup, popupOptions)) + // When the Android Back Button is tapped, we only close the Popup if the tapOutsideOfPopupCommand can execute + // In other words, we'll only close the Popup when CanBeDismissedByTappingOutsideOfPopup is true + if (tapOutsideOfPopupCommand.CanExecute(null)) { - CloseAsync(new PopupResult(true), CancellationToken.None).SafeFireAndForget(); + tapOutsideOfPopupCommand.Execute(null); } // Always return true to let the Android Operating System know that we are manually handling the Navigation request from the Android Back Button