iOS 8第三方键盘不注册javascript / jQuery keyup,keypress,keydown等 [英] iOS 8 3rd party keyboards don't register javascript/jQuery keyup, keypress, keydown etc
本文介绍了iOS 8第三方键盘不注册javascript / jQuery keyup,keypress,keydown等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用像Swiftkey这样的第三方键盘时,像keypress这样的javascript事件不会注册。例如,Google地图自动填充功能无法使用 https://developers.google。 com / maps / documentation / javascript / examples / places-autocomplete
When using a 3rd party keyboard like Swiftkey javascript events like keypress don't register. For example Google maps autocomplete won't work https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
好像是一个iOS错误,但有关如何解决这个问题的想法?
Seems like an iOS bug but any ideas on how I can get around this?
推荐答案
我找到了一个使用setInterval和解决方法的解决方案触发Google地方自动填充功能
I found a solution using setInterval and the answered method from here Trigger Google Places Autocomplete
setInterval(function() {
if ($('input#mapSearch').is(':focus')) {
google.maps.event.trigger(document.getElementById('mapSearch'), 'focus', {});
}
}, 500);
这篇关于iOS 8第三方键盘不注册javascript / jQuery keyup,keypress,keydown等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文