单击按钮时,保持键盘在Ionic上处于打开状态(聊天应用程序) [英] keep keyboard open on Ionic when button click ( chat app )

查看:111
本文介绍了单击按钮时,保持键盘在Ionic上处于打开状态(聊天应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Ionic v1聊天应用程序,我做了一切,但是当单击发送按钮(发送聊天)时,我遇到了一个著名的问题,键盘失去了输入的注意力,然后关闭了.

I have an Ionic v1 chat application, I made everything, but I encountred the famous problem when clicking on a send button (send chat) the keyboard loses focus from the input and then closes.

我尝试了很多方法,但是它们都不起作用:

I've tried many approaches, but it none of them work:

  • 输入指令以保持焦点
  • 将重点放在点击事件上,
  • 将config.xml中的InputUserAction的值修改为false.

非常感谢您的帮助.

<div class="sender">
<input type="text" ng-model="..." class="...">
<div class="button-send">
<span class="send-chat"><i class="ion ion-send"></i></span>
</div>
</div>

推荐答案

AL正确地找到了解决方法! 对于正在使用ionic进行类似应用聊天的所有人,并希望键盘在单击按钮后保持专注,

ALright found a fix! for all of you out there, who are using ionic for a chat like app, and want the keyboard to stay focused after clicking on a button,

只需将按钮替换为带有for ="inputID"的标签,如下所示:

Just, replace the button by a label with for="inputID" like so:

<div class="sender">
<input id="inputID" type="text" ng-model="..." class="...">
<div class="button-send">
<label for="inputID" class="send-chat"><i class="ion ion-send"></i></label>
</div>
</div>

这篇关于单击按钮时,保持键盘在Ionic上处于打开状态(聊天应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆