Skip to content

[Ionic V4.0.0-beta.13] autofocus input causes modal to disappear on ios #16136

Closed

Description

@dylanvdmerwe

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)             : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.13
   @angular-devkit/build-angular : 0.7.5
   @angular-devkit/schematics    : 0.7.5
   @angular/cli                  : 6.1.5
   @ionic/angular-toolkit        : not installed

Cordova:

   cordova (Cordova CLI) : 8.1.1 ([email protected])
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 13 other plugins)

System:

   ios-deploy : 2.0.0
   ios-sim    : 7.0.0
   NodeJS     : v10.11.0 (/usr/local/bin/node)
   npm        : 6.4.1
   OS         : macOS
   Xcode      : Xcode 10.0 Build version 10A255

Describe the Bug
I have a modal that has a single input on it. I marked this input with autofocus. When the page opens it looks as though the following happens:

  • Modal is animated in
  • The autofocus causes the input to be immediately selected
  • The OSK appears
  • The modal flies off the screen.

The app then needs to be restarted.

ezgif-4-30f87ca5f74b

Note that this only happens on iOS, not Android or desktop. Removing autofocus and the modal behaves correctly.

Related Code

  <ion-list lines='none'>
    <ion-item mode='md' lines="none" class='venue-code'>
      <ion-label position='stacked'>Please enter the venue code</ion-label>
      <ion-input class='custom-input' placeholder='Venue Code' type='text' autocapitalize='off' [(ngModel)]='code'
        debounce='450' (ionChange)='codeChanged()' clearInput autofocus></ion-input>
    </ion-item>
  </ion-list>

Expected Behavior
The modal should not go anywhere when the OSK appears.

I am using the ionic-keyboard and ionic-webview plugins:

    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.2.0",

Activity

  1. paulstelzer commented on Dec 7, 2018

    @paulstelzer
    Contributor

    Br, that's a very annoying issue. Have you checked if this is still an issue in beta.17? Maybe I will check it in future in my app, but cannot promise it

  2. added
    needs: reply
    and removed on Dec 7, 2018
  3. ionitron-bot commented on Jan 6, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

    Thank you for using Ionic!

  4. added
    package: angular
    and removed
    needs: reply
    on Jan 9, 2019
  5. paulstelzer commented on Jan 13, 2019

    @paulstelzer
    Contributor

    I hope this will be fixed with #17043 . Could you check after rc2 release if this is still a problem?

  6. added
    needs: reply
    and removed
    package: angular
    on Jan 13, 2019
  7. dylanvdmerwe commented on Jan 13, 2019

    @dylanvdmerwe
    ContributorAuthor

    Will check in next release.

  8. added and removed
    needs: reply
    on Jan 13, 2019
  9. added
    needs: reply
    and removed on Jan 15, 2019
  10. ionitron-bot commented on Feb 14, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

    Thank you for using Ionic!

  11. locked and limited conversation to collaborators on Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: reply

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions