gpt4 book ai didi

html - 单击按钮时在 Ionic 上保持键盘打开(聊天应用程序)

转载 作者:行者123 更新时间:2023-12-02 18:04:20 25 4
gpt4 key购买 nike

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

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

  • 输入指令以保持焦点,
  • 强制关注点击事件,
  • 修改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>

最佳答案

只需使用 (mousedown)="sentMessage(); $event.preventDefault()"

<ion-button (mousedown)="sentMessage(); $event.preventDefault()">
<ion-icon ios="ios-send" md="md-send"></ion-icon>
</ion-button>

关于html - 单击按钮时在 Ionic 上保持键盘打开(聊天应用程序),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45858201/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com