Skip to content
Zeno Rocha edited this page May 8, 2016 · 13 revisions

Bootstrap's modal enforce focus for accessibility reasons but that causes problems with LOTS of third-party libraries, including clipboard.js.

You can turn off this functionality by doing...

Bootstrap 3

$.fn.modal.Constructor.prototype.enforceFocus = function() {};

Bootstrap 4

$.fn.modal.Constructor.prototype._enforceFocus = function() {};

If you want to know exactly what you're overriding, check the _enforceFocus function implementation.

Originally reported at #155


jQuery UI's Dialog also enforce focus for accessibility purposes. You can disabled that by running:

$.ui.dialog.prototype._focusTabbable = $.noop;

If you want to understand what you're overriding, check the _focusTabbable function implementation.

Originally reported at #187


On IE9-11 there's a prompt that asks if the user wants to allow access to his/her clipboard.

screen shot 2015-10-14 at 8 49 20 pm

If the user allows, everything will work as expected. But if the user denies access, it will still emit the success event. The root cause of the problem is that document.execCommand returns true even if it does not have permissions.

Originally reported at #77

Clone this wiki locally