ionic-team / ionic-team/ionic-framework

bug: IonModal dismissing animation on iOS can look strange with the keyboard up

未关闭
#30,144 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/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

v8.x

### Current Behavior

On iOS only, if you use IonModal and have an input box with the keyboard up, when you dismiss the modal, it animates sliding off the screen. Unfortunately, it seems to slide to a position assuming the keyboard remains visible. When the keyboard is hidden, you can still see the modal sitting at the bottom for a second before it disappears. I found an existing issue that describes it better than me and has a video demonstrating it: https://github.com/ionic-team/ionic-framework/issues/20686 I know that issue says it's fixed in Ionic 5, but if that's true, it seems to be back. I plan to work around the issue with
```ts
Keyboard.hide().then(() => {
setTimeout(() => {
this.modalCtrl.dismiss();
}, 150);
});
```
Basically using the Capacitor Keyboard plugin to hide the keyboard, give it a little time for animations and then dismissing the modal (inspired by the suggestion on the old issue.

### Expected Behavior

Dismissing IonModal should have it slide down smoothly off the screen.

### Steps to Reproduce

Open an IonModal that has an input box
Focus the input box so that the keyboard appears (if using the Simulator, you may need to turn off hardware keyboard)
Dismiss the IonModal

### Code Reproduction URL

https://github.com/chrisjdev/ionModalBug

### Ionic Info

Ionic:

Ionic CLI : 7.2.0 (~/.nvm/versions/node/v20.16.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.4.1
@angular-devkit/build-angular : 19.1.3
@angular-devkit/schematics : 19.1.3
@angular/cli : 19.1.3
@ionic/angular-toolkit : not installed

Capacitor:

Capacitor CLI : 7.0.1
@capacitor/android : not installed
@capacitor/core : 7.0.1
@capacitor/ios : 7.0.1

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.16.0 (~/.nvm/versions/node/v20.16.0/bin/node)
npm : 10.8.1
OS : macOS Unknown

### Additional Information

I lied when I checked the box for "I have searched for existing issues that already report this problem, without success.". I had to in order to create the issue. I noted the existing (closed) issue that already reports this problem in the description.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。