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: autofocus input causes modal animation be incorrect on ios #18257

Open
msigwart opened this issue May 10, 2019 · 8 comments
Open

bug: autofocus input causes modal animation be incorrect on ios #18257

msigwart opened this issue May 10, 2019 · 8 comments
Labels
bug: external Bugs in non-Ionic software that impact Ionic apps (I.e. WebKit, Angular, Android etc) type: bug a confirmed bug report

Comments

@msigwart
Copy link

Bug Report

Ionic version:

[x] 4.x

Current behavior:

The same issue as reported in #16136:
When setting autofocus on an ion-input element in a modal in ios, the modal content disappears.

Expected behavior:

The modal content does not disappear.

Steps to reproduce:

  1. Create an Ionic App
  2. Create a Modal with const modal = await this.modalController.create({...
  3. Set autofocus on an ion-input element in the modal component

Related code:

modal.component.html:

<ion-header>
  <ion-toolbar>
    <ion-title>Some Modal Component</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content padding>
  <ion-item>
    <ion-label position="floating">Some Input</ion-label>
    <ion-input type="text" autofocus></ion-input>
  </ion-item>
</ion-content>

Other information:

Related issue: #16136

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0
   Ionic Framework               : @ionic/angular 4.4.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.3.8
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1
   NodeJS            : v11.9.0
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001
@calendee
Copy link

calendee commented Sep 29, 2019

I am observing the same problem in Ionic React RC2/RC3 on mobile devices only. If the device is rotated to landscape and then back, the "bad" modal displays properly.

Demo: https://ionic-react-auto-focus-modal-bug.netlify.com

Reproducible Sample: https://github.com/calendee/ionic-react-auto-focus-modal-bug/tree/master

Here's a demo of it - watch to the end - sorry it's really slow to demonstrate the whole problem.
Ionic React Auto Focus Modal Bug 2019-09-29 09_45_47

@sagrawal31
Copy link

sagrawal31 commented Nov 20, 2019

We are also facing this issue. We are using latest version of @ionic/angular, cordova-plugin-ionic-webview and cordova-plugin-ionic-keyboard

@aaadipop
Copy link

same here

@cytrics
Copy link

cytrics commented Sep 15, 2020

I still have the problem. is there a solution now?

System:

Ionic:

Ionic CLI : 6.11.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.2.3
@angular-devkit/build-angular : 0.901.11
@angular-devkit/schematics : 9.1.11
@angular/cli : 9.1.11
@ionic/angular-toolkit : 2.2.0

Capacitor:

Capacitor CLI : 2.2.1
@capacitor/core : 2.2.1

Cordova:

Cordova CLI : 10.0.0
Cordova Platforms : ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)

@liamdebeasi liamdebeasi added type: bug a confirmed bug report and removed needs: investigation package: angular @ionic/angular package package: core @ionic/core package labels Dec 3, 2020
@liamdebeasi
Copy link
Contributor

Hi everyone,

This issue appears to be due to a bug in WebKit (the engine that powers Safari) where autofocus causes animations to be run incorrectly. I will look into filing an issue with the WebKit team.

As of now, I am not aware of a workaround but I will post here if I find one.

@flavioribeirojr
Copy link

Did anyone found a solution or workaround for this?

@liamdebeasi
Copy link
Contributor

No workaround at the moment. I reported this to the WebKit team, and they can reproduce it on their end: https://bugs.webkit.org/show_bug.cgi?id=219506

@liamdebeasi liamdebeasi added the bug: external Bugs in non-Ionic software that impact Ionic apps (I.e. WebKit, Angular, Android etc) label Aug 20, 2021
@jaminm
Copy link

jaminm commented Sep 16, 2021

Same here, caused the modal to jump up past the top of the screen then back down, removed autofocus and it animates correctly. This only happened on iOS phones, Safari and Chrome.

@liamdebeasi liamdebeasi changed the title bug: autofocus input causes modal to disappear on ios bug: autofocus input causes modal animation be incorrect on ios Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: external Bugs in non-Ionic software that impact Ionic apps (I.e. WebKit, Angular, Android etc) type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

9 participants