While using Bootstrap 2.3
, Bootbox and viewing the result in Google Chrome on Ubuntu you get a less than appealing border around the button because it is auto-focused. I havent found any api hooks to trigger a blur event once the modal is shown. Is there a way to remove the autofocus with javascript alone or maybe just css but without the option to fork the project, remove the autofocus and make it configurable?
Asked
Active
Viewed 986 times
3

ezraspectre
- 3,148
- 5
- 23
- 28
-
1You can inspect and see if there is any class / id applied to button which will help you to select it to trigger blur() event.. – Rahul Patil Dec 21 '13 at 16:25
-
1Thanks Rahul -- I used `a.btn:focus { outline: none; }` – ezraspectre Dec 21 '13 at 19:28
1 Answers
0
There is no API hook, but you can do it by attaching a javascript event handler to the alert:
var bbAlert = bootbox.alert('Alert!')
bbAlert.on('shown.bs.modal', function(){
$('.btn-primary').blur();
});

user5493187
- 212
- 5
- 16