Skip to content

Commit

Permalink
Improve airmode focusout
Browse files Browse the repository at this point in the history
This change checks if the airpopover is active or has focus before hiding it on a focusout event. This is a more compatible check than the previous one and works in all browsers.
  • Loading branch information
andrews05 authored and lqez committed Dec 25, 2019
1 parent 1e94357 commit 2e98e6d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/js/base/module/AirPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ export default class AirPopover {
this.hide();
},
'summernote.focusout': (we, e) => {
// [workaround] Firefox/Safari don't support relatedTarget on focusout
// - Ignore hide action on focus out in FF/Safari.
if (env.isFF || env.isSafari) {
return;
}

if (!e.relatedTarget || !dom.ancestor(e.relatedTarget, func.eq(this.$popover[0]))) {
if (!this.$popover.is(':active,:focus')) {
this.hide();
}
},
Expand Down

0 comments on commit 2e98e6d

Please sign in to comment.