diff --git a/js/popover.js b/js/popover.js
index 1a1ffa4..4e591d8 100644
--- a/js/popover.js
+++ b/js/popover.js
@@ -45,6 +45,13 @@ var Drupal = Drupal || {};
       }
 
       var _this = this;
+      var focusBehavior = function (e) {
+        var $target = $(e.target);
+        if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($target) && !$target.closest('.popover.in')[0]) {
+          _this.$activePopover.popover('hide');
+          _this.$activePopover = null;
+        }
+      };
 
       $document
         .on('show.bs.popover', '[data-toggle=popover]', function () {
@@ -59,13 +66,7 @@ var Drupal = Drupal || {};
             _this.$activePopover = $trigger;
           }
         })
-        .on('focus.bs.popover', ':focusable', function (e) {
-          var $target = $(e.target);
-          if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($target) && !$target.closest('.popover.in')[0]) {
-            _this.$activePopover.popover('hide');
-            _this.$activePopover = null;
-          }
-        })
+        .on('focus.bs.popover', focusBehavior)
         .on('click.bs.popover', function (e) {
           var $target = $(e.target);
           if (_this.$activePopover && _this.getOption('autoClose') && !$target.is('[data-toggle=popover]') && !$target.closest('.popover.in')[0]) {
@@ -81,6 +82,10 @@ var Drupal = Drupal || {};
         })
       ;
 
+      if (typeof jQuery.ui !== 'undefined') {
+        $document.on(':focusable', focusBehavior);
+      }
+
       var elements = $(context).find('[data-toggle=popover]').toArray();
       for (var i = 0; i < elements.length; i++) {
         var $element = $(elements[i]);
