From 94bee57ccde1a1f7a2b03e246af97981e020a79c Mon Sep 17 00:00:00 2001 From: Vladislav Antonyuk Date: Wed, 15 Jan 2025 20:45:56 +0200 Subject: [PATCH] Fix back button --- .../Views/Popup/PopupContainer.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/CommunityToolkit.Maui/Views/Popup/PopupContainer.cs b/src/CommunityToolkit.Maui/Views/Popup/PopupContainer.cs index d5bc9ff0e..64c81fd76 100644 --- a/src/CommunityToolkit.Maui/Views/Popup/PopupContainer.cs +++ b/src/CommunityToolkit.Maui/Views/Popup/PopupContainer.cs @@ -47,10 +47,15 @@ public PopupContainer(Popup content, TaskCompletionSource? taskComp On().SetModalPresentationStyle(UIModalPresentationStyle.OverFullScreen); } - //protected override bool OnBackButtonPressed() - //{ - // return !CanBeDismissedByTappingOutsideOfPopup; - //} + protected override bool OnBackButtonPressed() + { + if (CanBeDismissedByTappingOutsideOfPopup) + { + return base.OnBackButtonPressed(); + } + + return true; + } /// /// Gets or sets a value indicating whether the popup can be dismissed by tapping outside the Popup.