Ionic 3 - Ion-Item Clickable

Asked

Viewed 682 times

1

When using the ION-ITEM directive within ION-LIST, it is not possible to click on any element inside, e.g.: a text field (input), when testing with the iOS emulator in Chrome.

<ion-list class="list-form">
  <ion-item tappable>
    <ion-label floating>
      <ion-icon name="mail" item-start class="text-white"></ion-icon>
      Email
    </ion-label>
    <ion-input type="email" formControlName="email"></ion-input>
  </ion-item>

  <ion-item>
    <ion-label floating>
      <ion-icon name="lock" item-start class="text-white"></ion-icon>
      Senha
    </ion-label>
    <ion-input type="password" formControlName="password"></ion-input>
  </ion-item>
</ion-list>
  • You want to click on the items?

  • yes, on android and web browser works, only on iOS that does not.

1 answer

0

Try using ionFocus instead of clicking.

<ion-input type="email" formControlName="email" (ionFocus)="doSomething()"></ion-input>

There are several open issues about this problem, and I believe that it can be solved in a future version. The problem is not the item but the input within it.

  • But I don’t want to call a function in Focus... actually I can’t even focus on the field!

  • I didn’t understand, I thought your problem was with some event clicking on the component. You say that the components are frozen so?

  • Exactly, I can’t even click inside any element within the ion-item! Really like Voce said iOS has a bug in that direction!

  • @mcamara Have you tried to update your version of Ionic?

  • Yes... But I think I managed to solve the problem, I had to remove the ion-list :(

  • Got it, @mcamara. If you solved your problem, add an answer, that way you can help other people with the same problem

  • but me solving my problem doesn’t mean it’s right, do you agree? Since it was just a way around the problem!

  • 1

    You can say this when you answer, that since you did not find a solution, you decided to do it the way it is. I think it’s better than being unanswered. And it also makes sense, because maybe it’s really a bug, as we said, it has several open issues with equal or similar problems.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.