jQuery UI dialog button focus

前端 未结 13 2184
时光取名叫无心
时光取名叫无心 2020-12-13 12:08

When a jQuery UI dialog opens, it selects one of the buttons and highlights it or sets focus to it etc... How can I stop this behaviour so that none of the buttons are highl

13条回答
  •  旧时难觅i
    2020-12-13 12:57

    Just add this line to remove the autofocus functionality:

    $.ui.dialog.prototype._focusTabbable = function(){};
    

    You can add it in a shared javascript file and it will prevent autofocus of all your dialogs! No more copy and paste in all your dialogs

提交回复
热议问题