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

MAUI DisplayAlert not modal on Android 10 #15671

Closed
FrantisekPregis opened this issue Jun 15, 2023 · 2 comments
Closed

MAUI DisplayAlert not modal on Android 10 #15671

FrantisekPregis opened this issue Jun 15, 2023 · 2 comments

Comments

@FrantisekPregis
Copy link

Description

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.

František

Public API Changes

[DisplayAlert(String, String, String, String, FlowDirection, CanBeDissmissedByTappingOutside)]

[DisplayActionSheet(String, String, String, String[], CanBeDissmissedByTappingOutside)]

Intended Use-Case

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 dismissable option would lead to more elegant behavior.

@jsuarezruiz jsuarezruiz added the area-controls-dialogalert DisplayAlert, dialog label Jun 16, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jun 16, 2023
@MV10
Copy link

MV10 commented Aug 16, 2023

The same thing happens with DisplayActionSheet on Windows (but not DisplayAlert).

Also DisplayActionSheet returns null when this happens (both Windows and Android) which can lead to unexpected failures versus the documented behavior.

@mattleibow
Copy link
Member

Duplicate of dotnet/docs-maui#1924

@mattleibow mattleibow marked this as a duplicate of dotnet/docs-maui#1924 Nov 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants