Autocomplete requires you to click twice in iOS after update to 1.11.0

前端 未结 12 1195
野趣味
野趣味 2020-12-01 02:41

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.

The problem

We recently upgraded from

12条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 03:07

    you can probably can use the focus event from autocomplete!

    focus( event, ui )

    $(function() {
      var availableTags = [
        "ActionScript",
        "AppleScript",
        "Asp",
        "BASIC",
        "C",
        "C++",
        "Clojure",
        "COBOL",
        "ColdFusion",
        "Erlang",
        "Fortran",
        "Groovy",
        "Haskell",
        "Java",
        "JavaScript",
        "Lisp",
        "Perl",
        "PHP",
        "Python",
        "Ruby",
        "Scala",
        "Scheme"
      ];
    
      var selectAction = function(event, ui) {
        //do whatever you want with event and ui objects
        console.log(ui.item)
      }
    
      $("#tags").autocomplete({
        source: availableTags,
        focus: selectAction,
        select: selectAction
      });
    });
    
    
    
    
    

提交回复
热议问题