ionic-team / ionic-team/ionic-framework

feat: resolve overlay present method early when dismissing during enter animation

Đang mở
#29,261 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
package: core type: feature request
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### 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

```html
Test modal
```
```typescript
async openModal() {
const modal = await this._modalController.create({
component: Tab2Page,

cssClass: 'modal-alert-component',
});

await modal.present();

const response = await modal.onWillDismiss();

console.log('response', response);
}
```

1. Open the chrome dev tool under the `console` element
2. Click on the `Test modal`
3. Click on escape button of your keyboard directly after opening it
4. `response` Won't be logged, as the `onWillDismiss()` 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.