简体   繁体   English

离子项内的离子 - textarea不能在IONIC 2上工作

[英]ion-textarea inside ion-item not working on IONIC 2

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. 它显示很好,但当我按下textarea时,它会显示并隐藏键盘。 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. 这就像在我触摸屏幕之后触发了onblur事件。

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? 有任何想法吗?

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. 我输入相同的东西,直到我把它们包裹在div中。

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. 它需要一个ItemSliding包装元素才能被刷卡。

You may want to restructure your code or format that ion-item in a list of some sort. 您可能希望重新构建代码或将某个离子项格式化为某种列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM