JQuery用户界面自动完成自动消防(IE) [英] JQuery UI Autocomplete automatically fire (IE)

查看:116
本文介绍了JQuery用户界面自动完成自动消防(IE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常不好的问题与jQuery自动完成和Internet Explorer。

I have a very bad problem with JQuery Autocomplete and the Internet Explorer.

首先,我有一个输入字段具有特殊字符值,如:

First I have a input field with a special char value like:

<div class="ui-widget">
    <label for="tags">Tags: </label>
    <input id="tags" value="Häskell">
</div>

然后我的JQuery用户界面自动完成code看起来像

Then my JQuery UI Autocomplete Code looks like

$(function() {
        var availableTags = [
            "ActionScript",
            "AppleScript",
            "Asp",
            "BASIC",
            "C",
            "C++",
            "Clojure",
            "COBOL",
            "ColdFusion",
            "Erlang",
            "Fortran",
            "Groovy",
            "Häskell",
            "Java",
            "JavaScript",
            "Lisp",
            "Perl",
            "PHP",
            "Python",
            "Ruby",
            "Scala",
            "Scheme"
        ];
        $( "#tags" ).autocomplete({
            source: availableTags
        });
    });

现在,当我访问该网站的Internet Explorer中,自动完成自动闪光,给我看条目哈斯克尔。 (您也可以preSS F5重现bug)
但是,只有当输入字段值就好了,ö,...

Now when i visit the site with the Internet Explorer, the autocomplete automatically fire and show me the entry "Häskell". (You also can press F5 to reproduce the bug) But that only happens when the input field value has a special char like ä, ö, ...

我还发现了一个Bug票务 http://bugs.jqueryui.com/ticket/9796# NO1

I also found a Bug Ticket http://bugs.jqueryui.com/ticket/9796#no1

有人可以帮我吗?

非常感谢!

推荐答案

要你应该有点修改jQuery UI的prevent这种情况下(这是IE浏览器的漏洞实际和部分jQuery的)。问题是,在明年的功能。 IE上升事件投入,其中另一个browers不涨它。
之前修改这个功能有一个视图:

To prevent such event you should a bit modify jquery ui (it is real bug of IE and partially jquery). Problem is in next feature. IE rises event "input" where another browers does not rise it. before modifying this function has next view:

input:function(e) {
  if (r) {
    r =! 1, e.preventDefault();
    return;
  }
  this._searchTimeout(e)
}



你应该把它修改为下一


You should modify it to next

input:function(e) {
  if (r || typeof(r) == "undefined") {
    r =! 1, e.preventDefault();
    return;
  }
  this._searchTimeout(e)
}

这篇关于JQuery用户界面自动完成自动消防(IE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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