Improved popup dismiss options #2875
reck1610
started this conversation in
New Feature Discussions
Replies: 1 comment
-
My main problem with the current behavior is, that it is not possible to only prevent dismissal by tap outside of popup. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently,
PopupOptions.OnTappingOutsideOfPopup
will only get invoked when the popup is dismissed.If
CanBeDismissedByTappingOutsideOfPopup
is set to falsePopupOptions.OnTappingOutsideOfPopup
will not get invoked.Furthermore,
PopupOptions.OnTappingOutsideOfPopup
will get invoked if the back button is pressed on Android.I don't like this.
I propose the following changes:
PopupOptions.OnTappingOutsideOfPopup
should be renamed toPopupOptions.OnDismiss
PopupOptions.OnTappingOutsideOfPopup
should be created an get fired regardless ofCanBeDismissedByTappingOutsideOfPopup
PopupOptions.OnBackButtonPressed
should be createdCanBeDismissedByBackButtonPressed
CanBeDismissedByTappingOutsideOfPopup
andCanBeDismissedByBackButtonPressed
would only change the dismissal behavior.PopupOptions.OnTappingOutsideOfPopup
andPopupOptions.OnBackButtonPressed
can be used to implement custom behavior.PopupOptions.OnDismiss
can be used to get the current behavior.I have already implemented such a change in https://github.com/reck1610/CommunityToolkit.Maui/tree/improve-popup-dismiss
Beta Was this translation helpful? Give feedback.
All reactions