Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ion-textarea inside ion-item not working on IONIC 2

Tags:

I have an ion-textarea inside of ion-item. It's shows fine, but when I press over the textarea, it's shows and hides the keyboard. And because the keyboard is hidden, I cannot put any text.

It's like that onblur event was triggered inmediatly after that I touched screen.

This is my code:

<ion-item>
    <ion-label stacked>Comment</ion-label>
    <ion-textarea [(ngModel)]="formData.comment" name="comment" placeholder="Put any comment..."></ion-textarea>
</ion-item> 

Any ideas?

like image 513
Vladimir Venegas Avatar asked Jan 17 '17 20:01

Vladimir Venegas


1 Answers

You will often run into errors like this whenever using ion-item in that manner. I had the same thing happen with inputs until I just wrapped them in a div instead.

Per the docs - An item can contain text, images, and anything else. Generally it is placed in a list with other items. It can easily be swiped, deleted, reordered, edited, and more. An item is only required to be in a List if manipulating the item via gestures is required. It requires an ItemSliding wrapper element in order to be swiped.

You may want to restructure your code or format that ion-item in a list of some sort.

like image 91
Caleb Swank Avatar answered Sep 24 '22 10:09

Caleb Swank