jQuery UI dialog button focus

前端 未结 13 2178
时光取名叫无心
时光取名叫无心 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 12:53

    Well, all solutions here seems to go with code or hacks. So I'll post mine, that is based just in CSS override. What bothered me was the outline that made the button look as "selected", so I simply overrided it with "none":

    .ui-dialog .ui-dialog-titlebar button.ui-button:focus,
    .ui-dialog .ui-dialog-titlebar button.ui-button.ui-state-focus,
    .ui-dialog .ui-dialog-titlebar button.ui-button.ui-state-active,
    .ui-dialog .ui-dialog-titlebar button.ui-button.ui-state-hover  {
        outline:none;
    }
    

    You can also add/override any other style that is bothering you :)

提交回复
热议问题