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
By awaiting modal.present() you were blocking execution until the modal was fully presented. This means when dismissing the modal before the animation completes, the lifecycle event is emitted before the onWillDismiss is registered.
I think this is an area we could explore resolving the present promise early if the user dismisses the overlay during the animation to simplify the developer experience.
I'm going to capture this as a feature request 👍
sean-perkins
changed the title
bug: HTMLIonModalElement.onWillDismiss() isn't triggered if close happen to fast
feat: resolve overlay present method early when dismissing during enter animation
Apr 5, 2024
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
If I close the modal to quickly, the
onWillDismiss()
will never occur.Expected Behavior
Working as if I would close the modal normally
Steps to Reproduce
console
elementTest modal
response
Won't be logged, as theonWillDismiss()
is not triggered.Code Reproduction URL
https://github.com/rbalet/error-on-will-dismiss
Ionic Info
Ionic:
Ionic CLI : 7.1.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 7.8.2
@angular-devkit/build-angular : 17.3.3
@angular-devkit/schematics : 17.3.3
@angular/cli : 17.3.3
@ionic/angular-toolkit : 11.0.1
Capacitor:
Capacitor CLI : 5.7.4
@capacitor/android : not installed
@capacitor/core : 5.7.4
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v20.11.0 (/usr/local/bin/node)
npm : 10.2.4
OS : macOS Unknown
Additional Information
No response
The text was updated successfully, but these errors were encountered: