3

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?

bootbox-autofocus

ezraspectre
  • 3,148
  • 5
  • 23
  • 28

1 Answers1

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