Ionic-framework: bug: "Next" keyboard button does not focus on correct field.

Created on 30 Sep 2019  路  12Comments  路  Source: ionic-team/ionic-framework

Bug Report

Ionic version:
[x] 4.10.0

Current behavior:
When I click the "next" button on the keyboard, the focus goes to the next "ion-input" field, even though I previously had an "ion-select" field.

Expected behavior:
When you click the "next" button the focus should go to the next "ion-item" of the form.

Steps to reproduce:
Start a new project
On a page, put the code below

Related code:

  <form>
    <ion-item tabindex="1">
      <ion-label color="secondary" position="floating" stacked>Item 1
      </ion-label>
      <ion-input text-uppercase maxlength="60" class="f-14" type="text" clearInput></ion-input>
    </ion-item>

    <ion-item tabindex="2">
      <ion-label color="secondary" position="floating" stacked>Item 2
      </ion-label>
      <ion-select class="f-14" [interfaceOptions]="{ header: 'TESTE' }" okText="CONFIRMAR" cancelText="CANCELAR"
        interface="alert">
        <ion-select-option class="f-14">
          valor</ion-select-option>
      </ion-select>
    </ion-item>

    <ion-item tabindex="3">
      <ion-label color="secondary" position="floating" stacked>Item 3
      </ion-label>
      <ion-select class="f-14" [interfaceOptions]="{ header: 'TESTE' }" okText="CONFIRMAR" cancelText="CANCELAR"
        interface="alert">
        <ion-select-option class="f-14">
          valor</ion-select-option>
      </ion-select>
    </ion-item>

    <ion-item tabindex="4">
      <ion-label color="secondary" position="floating" stacked>Item 4

      </ion-label>
      <ion-input #enderecoCep class="f-14" maxlength="9" type="tel" clearInput>
      </ion-input>
    </ion-item>

    <ion-item tabindex="5">
      <ion-label color="secondary" position="floating" stacked>Item 5
      </ion-label>
      <ion-select class="f-14" [interfaceOptions]="{ header: 'TESTE' }" okText="CONFIRMAR" cancelText="CANCELAR"
        interface="alert">
        <ion-select-option class="f-14">
          valor</ion-select-option>
      </ion-select>
    </ion-item>

    <ion-item tabindex="6">
      <ion-label color="secondary" position="floating" stacked>Item 6
      </ion-label>
      <ion-input text-uppercase maxlength="60" class="f-14" type="text" clearInput></ion-input>
    </ion-item>


    <ion-item tabindex="7">
      <ion-label color="secondary" position="floating" stacked>Item 7
      </ion-label>
      <ion-input text-uppercase maxlength="60" class="f-14" type="text" clearInput></ion-input>
    </ion-item>

  </form>

Other information:
The focus sequence is in the fields:
1 --> 4 --> 6 --> 7. These are ion-input fields.

Ionic info:

Ionic CLI                     : 5.4.1
   Ionic Framework               : @ionic/angular 4.10.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.2.0
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : not available
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 26 other plugins)

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.8

System:

   Android SDK Tools : 26.1.1 (C:\Android\sdk)
   NodeJS            : v10.16.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.10.2
   OS                : Windows 10
core bug

Most helpful comment

Hi @liamdebeasi, thanks for the consideration.
It is noteworthy that it is not just "ion-select" components that have the bug. Components such as "ion-datetime" and "ionic-selectable" are also not gaining focus. That is, components that do not have a text input.

All 12 comments

Thanks for the issue. This is probably due to the fact that ion-select does not use a native input in the component where ion-input does. We will look into this!

Hi @liamdebeasi, thanks for the consideration.
It is noteworthy that it is not just "ion-select" components that have the bug. Components such as "ion-datetime" and "ionic-selectable" are also not gaining focus. That is, components that do not have a text input.

Hello,
I am also facing this problem.

+1

+1

+1

Tamb茅m estou com essa mesma situa莽茫o.

+1

Hi, please do not reply with a "+1". This causes everyone else who has interacted with the thread to receive an email. If you are also experiencing this issue, please add a reaction to the original comment at the top. Thanks!

Hi @liamdebeasi, any correction forecasts?

I have the same bug

Issue persists in ionic 5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandyscarney picture brandyscarney  路  3Comments

MrBokeh picture MrBokeh  路  3Comments

daveshirman picture daveshirman  路  3Comments

manucorporat picture manucorporat  路  3Comments

danbucholtz picture danbucholtz  路  3Comments