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

前端 未结 12 1199
野趣味
野趣味 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:17

    Building on onlydimon’s solution:

    var input = $("#input")
    // Initialize autocomplete
    input.autocomplete()
    // Retrieve the autocomplete list and remove the mouseenter event
    // which seems to trip up iOS Safari
    input.autocomplete('widget').off('mouseenter')
    

    I narrowed down the list of events to just jQuery's 'mouseenter' event. Removing just this one fixes the bug for me. Also, no need to remove it every time the list is opened; once is enough.

提交回复
热议问题