Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
chrisjdev opened this issue Jan 22, 2025 · 0 comments
Open
3 tasks done
Labels

Comments

@chrisjdev
Copy link

chrisjdev commented Jan 22, 2025

Prerequisites

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

        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.

@ionitron-bot ionitron-bot bot added the triage label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant