Improved popup dismiss options #2875
reck1610
started this conversation in
New Feature Discussions
Replies: 3 comments 3 replies
|
My main problem with the current behavior is, that it is not possible to only prevent dismissal by tap outside of popup. |
0 replies
|
I'd like to add to this support to intercept Android's back button within the popup. This would allow a wizard UI within a popup or control cancelation. |
1 reply
|
I also find the popup dismissal options way too limited 😕 Are the community toolkit maintainers open to the idea of improving it? I assume they would not want any breaking change to be introduced 🤔 |
2 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.
Uh oh!
There was an error while loading. Please reload this page.
Currently,
PopupOptions.OnTappingOutsideOfPopupwill only get invoked when the popup is dismissed.If
CanBeDismissedByTappingOutsideOfPopupis set to falsePopupOptions.OnTappingOutsideOfPopupwill not get invoked.Furthermore,
PopupOptions.OnTappingOutsideOfPopupwill get invoked if the back button is pressed on Android.I don't like this.
I propose the following changes:
PopupOptions.OnTappingOutsideOfPopupshould be renamed toPopupOptions.OnDismissPopupOptions.OnTappingOutsideOfPopupshould be created an get fired regardless ofCanBeDismissedByTappingOutsideOfPopupPopupOptions.OnBackButtonPressedshould be createdCanBeDismissedByBackButtonPressedshould be createdCanBeDismissedByTappingOutsideOfPopupandCanBeDismissedByBackButtonPressedwould only change the dismissal behavior.PopupOptions.OnTappingOutsideOfPopupandPopupOptions.OnBackButtonPressedcan be used to implement custom behavior.PopupOptions.OnDismisscan 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
All reactions