-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
bugSomething isn't workingSomething isn't workingneeds reproductionstaleThe author has not responded in over 30 daysThe author has not responded in over 30 daysunverified
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
This is the code snippet that calls ShowPopupAsync
protected override async void OnAppearing()
{
base.OnAppearing();
IsBusy = true;
try
{
if (String.IsNullOrEmpty(Model.Context.Location))
{
IPopupResult<Boolean> result = await PS.ShowPopupAsync<F12LocationPopup, Boolean>(Navigation, new PopupOptions
{
CanBeDismissedByTappingOutsideOfPopup = false,
PageOverlayColor = Colors.Orange.WithAlpha(0.4f),
}, CancellationToken.None);
if (Model.Step == 0)
{
await this.GoBackAsync(); return;
}
}
}
catch (Exception ex)
{
Vibration.Default.Vibrate(1000);
await DisplayAlert(Title, ex.Message, GlobalResource.Continue);
}
finally
{
IsBusy = false;
}
WeakReferenceMessenger.Default.Register<ScannerMessage>(this, (r, message) =>
{
MainThread.BeginInvokeOnMainThread(() =>
{
txtBarcode.Text = ScannerMessage.Parse($"{message.Data}");
OnBarcodeCompleted(txtBarcode, EventArgs.Empty);
});
});
await Model.Appearing(Sequence);
}
Expected Behavior
I expect that the task will stop and wait for the response from the popup, and from its response, the task must restart from
if (Model.Step == 0)
{
await this.GoBackAsync(); return;
}
Steps To Reproduce
In the example ShowPopupInOnAppearingPage, just add a statement afterward ShowPopupAsync and see if it gets executed.
Link to public reproduction project repository
https://github.com/CommunityToolkit/Maui/tree/main/samples
Environment
- .NET MAUI CommunityToolkit:
- OS:
- .NET MAUI:
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds reproductionstaleThe author has not responded in over 30 daysThe author has not responded in over 30 daysunverified