问题描述
我想有虚拟键盘jQuery的终端,这里是我的测试code:
插件code是在这里:(未提交)
I want to have virtual keyboard for jquery terminal, here is my test code: http://terminal.jcubic.pl/android.htmlthe plugin code is here: http://terminal.jcubic.pl/js/jquery.terminal-src.js (uncommitted)
一时间,是工作,但它停止,即使在当时我跑的重点和textarea的模糊键盘没有显示出来。光标是不是在文字区域。焦点/模糊的工作,当我运行在桌面铬的页面。
For a moment it was working but it stopped, even then I run focus and blur on textarea the keyboard don't show up. The cursor is not in textarea. The focus/blur work when I run the page on desktop Chromium.
有人知道为什么textarea的不具有焦点?
Anybody know why textarea don't have focus?
有时光标内但键盘显示不出来,并且没有绿色轮廓。有时它获得焦点,但随后模糊。虚拟键盘显示,只有当我点击里面的textarea。我找不到任何code可能导致这一点,为什么它的工作了一会儿(但不正是我想要)。
Sometimes the cursor is inside but the keyboard don't show up and there is no that green outline. Sometime it get focus but then blur. Virtual keyboard show up only when I click inside textarea. I can't find any code that may cause this and why it was working for a moment (but not exactly I wanted).
我已经尝试:
$('textarea').blur(function() { return false; });
或致电preventDefault当我点击终端。 (textarea的是我的剪贴板,但我想重新使用它)。我一直没有成功尝试不同的东西。
or call preventDefault when I click the terminal. (the textarea is my clipboard but I want to reuse it). I keep trying different things with no success.
推荐答案
我已经解决了这个问题,有关的Andorid我找到了两件事情。你可以不耽误触发焦点textarea的动作/输入它需要是直接调用(重点调用堆栈需要指向HTML /浏览器原生的动作),并且它似乎可以集中(触发虚拟键盘),只对本地事件(比如你不能专注于负载)。
I've solve the issue, two things about andorid I've found. You can't delay action that trigger focus on textarea/input it need to be direct call (stack of focus call need point to html/browser native action), and it's seems that you can focus (trigger virtual keyboard) only on native events, (for instance you can't focus on load).
这篇关于启用/禁用Android的虚拟键盘与虚拟的textarea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!