无法在手机上点击谷歌自动完成列表中的项目 [英] can't tap on item in google autocomplete list on mobile

查看:28
本文介绍了无法在手机上点击谷歌自动完成列表中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Phonegap 和 HTML 制作移动应用.现在我正在使用谷歌地图/地点自动完成功能.问题是:如果我在计算机上的浏览器中运行它,一切正常,并且我从自动完成列表中选择了一个建议使用 - 如果我将它部署在我的手机上,我仍然会收到建议,但我无法点击.似乎建议叠加"被忽略了,我可以点击页面.是否有可能将重点放在建议列表或类似的东西上?希望可以有人帮帮我.提前致谢.

I'm making a mobile-app using Phonegap and HTML. Now I'm using the google maps/places autocomplete feature. The problem is: if I run it in my browser on my computer everything works fine and I choose a suggestion to use out of the autocomplete list - if I deploy it on my mobile I still get suggestions but I'm not able to tap one. It seems the "suggestion-overlay" is just ignored and I can tap on the page. Is there a possibility to put focus on the list of suggestions or something that way ? Hope someone can help me. Thanks in advance.

推荐答案

FastClick 和 PAC 确实存在冲突.我发现我需要将 needsclick 类添加到 pac-item 及其所有子项.

There is indeed a conflict with FastClick and PAC. I found that I needed to add the needsclick class to both the pac-item and all its children.

$(document).on({
    'DOMNodeInserted': function() {
        $('.pac-item, .pac-item span', this).addClass('needsclick');
    }
}, '.pac-container');

这篇关于无法在手机上点击谷歌自动完成列表中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆