问题描述
我们正在开发一个移动Web应用程序在jQuery Mobile的1.0.1和1.4.1的PhoneGap和所遇到的问题与对GALAXY S2的键盘。
We are developing a mobile web app in jQuery Mobile 1.0.1 and Phonegap 1.4.1 and have run into issues with the keyboard on the galaxy s2.
我们有一个菜单,滑出,并包含一个搜索输入:
We have a menu which slides out and contains a search input:
<input type="search" placeholder="Search..." name="search" id="menu_search" data-role="none" />
当我们在输入抽头,使其获得焦点,键盘打开,但不允许我们键入。我想在这里线索东西是其给我们一个普通的文本键盘,而不是搜索键盘(其中有放大镜是回车键)
When we tap in the input so that it gains focus, the keyboard opens but does not allow us to type anything in. I guess a clue here is that its giving us a regular text keyboard and not the search keyboard (which has a magnifying glass as the enter key)
如果我们集中输入菜单打开时: $(#menu_search)专注()
- 搜索键盘打开时,菜单显示和我们。能够搜索,但只要我们在输入敲击键盘变为普通键盘,我们一个无法输入任何内容。
If we focus the input when the menu opens: $("#menu_search").focus()
- The search keyboard is open when the menu displays and we are able to search BUT as soon as we tap in the input the keyboard changes to a regular keyboard and we a not able to type anything.
另一条线索是,虽然在打字键盘的自动predict工程,但只有一个空间将被添加到其他字符的输入,没有正确的选项攻丝时。
Another clue is that while typing in the keyboard the auto-predict works but when tapping on the correct option only a space is added to the input and none of the other characters.
我们已经尝试在搜索输入也没有用了一堆其他attribues的:
We have tried a bunch of other attribues on the search input to no avail:
<input type="search" placeholder="Search..." name="search" id="menu_search" value="" data-role="none" autocomplete="off" autocorrect="off" autocapitalization="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" style="-webkit-appearance:searchfield;" class="ui-autocomplete-input" />
这一切工作正常,在HTC Desire的运行2.2并运行CM7(安卓2.3.7)的愿望
This all works fine on a HTC Desire running 2.2 and a desire running CM7 (Android 2.3.7)
我们甚至试图改变输入到文本区域,但这的确pretty的很多类似的话:(
We even tried changing the input to a textarea but this did pretty much the same thing :(
我也试过:
$("#menu_search").live('focus',function(event){
event.preventDefault();
});
要查看是否将$更改键盘p $ pvent,但没有运气无论是。
to see if that would prevent it from changing keyboards but no luck either.
我们做不过有另外一个搜索输入其正常工作的应用程序在其他地方,唯一的区别是,其他搜索是一个propper页:数据角色=页面
键,菜单是所有其他网页外,并在自己刚刚设置为隐藏开始。
We do however have another search input elsewhere in the app which works fine, the only difference being that the other search is in a "propper" page: data-role="page"
and the menu is outside of all of the other pages and in its own just set to hidden initially.
请帮忙,IM哭了血ATM!
Please help, im crying blood atm!
推荐答案
您可能有
-webkit-user-select: none;
在你的CSS的地方。如果启用输入文本选择
In your CSS somewhere. If you enable text selection for inputs
input, textarea { -webkit-user-select: text; }
它的作品了!
it works again!
这篇关于使用jQuery Mobile和PhoneGap的输入错误与键盘上的GALAXY S2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!