[英]Need to press button twice, first to close keyboard second to send. How do I stop this?
I have a case where I have users that can enter text in a field for a mobile web site. 在某些情况下,我的用户可以在移动网站的字段中输入文本。
They then need to press a button to send the message but they have to press it twice, once to close the keyboard and the second to send the message. 然后,他们需要按下一个按钮来发送消息,但是必须按下两次,一次是关闭键盘,第二次是发送消息。
The sending is taking place via JQuery Ajax fired from an event handler. 发送是通过事件处理程序触发的JQuery Ajax进行的。 I have preventDefault on if that matters. 如果这很重要,我可以使用preventDefault。
Is there a way around this? 有没有解决的办法?
从单击按钮上的输入中移出焦点,以隐藏软件键盘:
$("input").blur();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.