dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.2k stars 1.75k forks source link

App Unresponsive when prompting the user from a new page #25585

Open czuck opened 1 week ago

czuck commented 1 week ago

Description

After opening a new page and setting IsBusy to true, a call is made to DisplayPromptAsync to prompt the user for information. The prompt doesn't appear, the page is unresponsive at the busy indicator.
This seems to be a timing issue, as adding an await Task.Delay before the prompt will alleviate the issue. In my production app it happens on both Android and iOS and my minimum Task.Delay to get it working is 150. In the reproduction app it happens in just Android and a Task.Delay of 50 will fix the issue. I also tested with DisplayAlert and DisplayActionSheet and they also cause the issue..

Steps to Reproduce

1: Download the reproduction app located at https://github.com/czuck/MauiTest 2: Run the app, tap the hamburger to access the flyout menu, Tap on Display Prompt Async. On iOS it will prompt, on Android it will not, the busy indicator will be running. 3: Edit DisplayPromptPage.cs and uncomment the await Task.Delay stmt on line 106. Follow step #2 on Android. This time you will get the prompt. 4: To test DisplayAlert and DisplayActionSheet comment lines 106 and 108 and uncomment 109 or 110, the follow steps 2 and 3 above.

Link to public reproduction project repository

https://github.com/czuck/MauiTest

Version with bug

8.0.61 SR6.1

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android, iOS

Affected platform versions

iOS 17.6.1, Android 14

Did you find any workaround?

Yes, adding a Task.Delay of sufficient time will get around the issue. The length of the delay needed is not constant.

Relevant log output

No response

moljac commented 6 days ago

I was able to repro with given sample.

Zhanglirong-Winnie commented 5 days ago

This issue has been verified using Visual Studio 17.12.0 Preview 4( 9.0.0-rc.2.24503.2 & 8.0.92 & 8.0.61 & 8.0.40 & 8.0.3). Can repro this issue on android and iso platforms.