How to implement “mustMatch” and “selectFirst” in jQuery UI Autocomplete?

前端 未结 13 960
一向
一向 2020-11-27 11:47

I recently migrated a few of my Autocomplete plugins from the one produced by bassistance to the jQuery UI autocomplete.

How can the \"mustMatch\" and \"selectFirst\

13条回答
  •  攒了一身酷
    2020-11-27 12:20

    I used something as simple as this for mustMatch and it works. I hope it helps someone.

            change: function (event, ui) {
                if (!ui.item) {
                     $(this).val('');
                 }
            }
    

提交回复
热议问题