You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The alert method of the modals plugin executes the callback immediately, before the user has closed the modal. This is problematic for code that is awaiting on the promise to be resolved, expecting it to be resolved only after the user closes the modal.
async showAlert() {
let alertRet = await Modals.alert({
title: 'Stop',
message: 'this is an error'
});
console.debug("After modal call hit!");
}
You can see this behavior using the example code from the documentation, by simply adding a console logging statement. You'll see the log statement executes immediately, even before the user closes the modal.
This is only a problem on iOS. On Android the log statement does not fire until the user dismisses the modal.
Expected Behavior
The console log statement should not execute until the user dismisses the modal.
Sample Code or Sample Application Repo
async showAlert() {
let alertRet = await Modals.alert({
title: 'Stop',
message: 'this is an error'
});
console.debug("After modal call hit!");
}
The text was updated successfully, but these errors were encountered:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
1.2.1
npx cap doctor
output:Affected Platform(s)
Current Behavior
The alert method of the modals plugin executes the callback immediately, before the user has closed the modal. This is problematic for code that is
await
ing on the promise to be resolved, expecting it to be resolved only after the user closes the modal.You can see this behavior using the example code from the documentation, by simply adding a console logging statement. You'll see the log statement executes immediately, even before the user closes the modal.
This is only a problem on iOS. On Android the log statement does not fire until the user dismisses the modal.
Expected Behavior
The console log statement should not execute until the user dismisses the modal.
Sample Code or Sample Application Repo
The text was updated successfully, but these errors were encountered: