Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayAlert & DisplayActionSheet dismiss behaviour is undocumented on Android #1924

Closed
mattleibow opened this issue Nov 30, 2023 · 0 comments · Fixed by #1981
Closed

DisplayAlert & DisplayActionSheet dismiss behaviour is undocumented on Android #1924

mattleibow opened this issue Nov 30, 2023 · 0 comments · Fixed by #1981
Assignees
Labels
doc-bug Problem with the content; needs to be fixed [org] dotnet-maui/tech dotnet-mobile/prod Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@mattleibow
Copy link
Member

mattleibow commented Nov 30, 2023

Type of issue

Other (describe below)

Description

I got an issue on the maui repo: dotnet/maui#15671

DisplayAlert can be dismissed by tapping outside of the alert window on Android 10, e.g.:

bool answer = await DisplayAlert("Question?", "Would you like to play a game", "Yes", "No");

In this case tapping outside the alert returns "No."

But the documentation (https://learn.microsoft.com/en-gb/dotnet/maui/user-interface/pop-ups) explicitly states that the behaviour should be modal. It behaves in a modal way on Windows 10.

Maybe this is a feature, but it would be great to have a non-dismissable option in the function, so important prompts have to be answered with one of the buttons. Same goes for DisplayActionSheet.

I would like to get an explicit answer from the user, by pressing one of the options. Tapping outside is analogical to Cancel, but the function returns only true or false. The user may not realise that by tapping outside she picked one of the options.

In case of DisplayActionSheet this can be handled, but I have to redisplay the pop up if a bad option is given by tapping outside. A non dismissible option would lead to more elegant behavior.

This is more a docs issue as although the DisplayAlert API appears to have options, it is not really meant to do anything but "accept" and "cancel" - and tapping outside the dialog counts as a "cancel" operation.

Similarly, the DisplayActionSheet API presents the user a choice of things, but the user can opt to not pick anything. This is a cancellation and will return null.

On touch platforms, you can tap outside the dialog, but on Windows you can also press escape to see similar actions... I think?

Page URL

https://learn.microsoft.com/en-gb/dotnet/maui/user-interface/pop-ups?view=net-maui-8.0

Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/pop-ups.md

Document Version Independent Id

144c1b04-ddfc-e59b-773f-94124fbbce7a

Article author

@davidbritch

Metadata

  • ID: 144c1b04-ddfc-e59b-773f-94124fbbce7a
  • Product: dotnet-mobile
  • Technology: dotnet-maui

Associated WorkItem - 187365

@issues-automation issues-automation bot added dotnet-maui/tech dotnet-mobile/prod Pri1 High priority, do before Pri2 and Pri3 labels Nov 30, 2023
@davidbritch davidbritch self-assigned this Nov 30, 2023
@davidbritch davidbritch added 🗺️ reQUEST Triggers an issue to be imported into Quest. doc-bug Problem with the content; needs to be fixed [org] labels Nov 30, 2023
@github-actions github-actions bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-bug Problem with the content; needs to be fixed [org] dotnet-maui/tech dotnet-mobile/prod Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants