自动完成需要您在更新到 1.11.0 后在 iOS 中单击两次 [英] Autocomplete requires you to click twice in iOS after update to 1.11.0

查看:18
本文介绍了自动完成需要您在更新到 1.11.0 后在 iOS 中单击两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 jQuery 2.1.0 和 jQuery.ui 1.11.0 在 iOS 7. iPhone 和 iPad Mini 中测试.适用于 Android 和常规浏览器.

Using jQuery 2.1.0 and jQuery.ui 1.11.0 Tested in iOS 7. iPhone and iPad Mini. Works on android and regular browsers.

我们最近从 jQuery UI 1.10.0 升级到 1.11.0,现在,当单击自动完成结果列表中的项目时,您只会获得悬停,您必须再次单击同一元素才能获得单击事件.这曾经在 1.10.0 版中运行良好.

We recently upgraded from jQuery UI 1.10.0 to 1.11.0 and now, when clicking an item in an autocomplete results list, you only get a hover, you have to click the same element again to get a click event. This used to work fine with version 1.10.0.

(评论中的 JSFiddle 链接)

使用 css {cursor: pointer} 不起作用

using css {cursor: pointer} does not work

使用 onclick="" 不起作用

(评论中的 JSFiddle 链接)

但有趣/奇怪的部分来了.它适用于 JSFiddle edit 视图,但不适用于 JSFiddle "/show" 页面.

But here comes the fun/weird part. It works in JSFiddle edit view, but not on the JSFiddle "/show" page.

JSFiddles: (键入一个字母以显示结果s"是一个好的)

编辑视图(有效)

我已经为此工作了好几天,但在仅测试 html 视图之前无法在 JSFiddle 中重现它.所以现在我转向你.我一生都无法弄清楚为什么一个页面会触发点击事件,而另一个页面却没有.

I've been working on this for days, but hadn't been able to reproduce it in JSFiddle before testing only the html view. So now I turn to you. I can't for the life of me figure out why the one page triggers a click event, and the other does not.

我正在使用 jQuery 自动完成最基本的功能.事实上,使用与 jQuery UI 主页上显示的完全相同的代码.

I am using the most basic function of jQuery autocomplete. In fact, using the exact same code that is presented on jQuery UI's home page.

那么,如何在 iOS 中的/show 页面上一键完成自动完成?

So, how do I get autocomplete to work with one click in iOS on the /show page?

(我会在评论中发布额外的链接,因为我还没有 10 个代表.除非我没有足够的代表发表评论......)

推荐答案

稍后,但是

$("#input").autocomplete({
    open: function(event, ui) {
        $('.ui-autocomplete').off('menufocus hover mouseover mouseenter');
    }
});

这篇关于自动完成需要您在更新到 1.11.0 后在 iOS 中单击两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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