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

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

    For some strange reason @onlydimon's answer didn't work for me. It seems like we do need event mouseenter. Following answer worked well for me.

    open: function (result) {
    
                if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
                    $('.ui-autocomplete').off('menufocus hover mouseover');
                }
            },
    

    I have added a condition to make sure that it doesn't break in other devices.

提交回复
热议问题