0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Don't consider editor focused if sub-element focused

Fixes #267
This commit is contained in:
Neil Jenkins 2017-05-10 14:22:56 +10:00
parent 632aae016b
commit 283a7d1d85
3 changed files with 3 additions and 3 deletions

View file

@ -2709,7 +2709,7 @@ proto.fireEvent = function ( type, event ) {
// focus event to fire after the blur event, which can cause an infinite // focus event to fire after the blur event, which can cause an infinite
// loop. So we detect whether we're actually focused/blurred before firing. // loop. So we detect whether we're actually focused/blurred before firing.
if ( /^(?:focus|blur)/.test( type ) ) { if ( /^(?:focus|blur)/.test( type ) ) {
isFocused = isOrContains( this._root, this._doc.activeElement ); isFocused = this._root === this._doc.activeElement;
if ( type === 'focus' ) { if ( type === 'focus' ) {
if ( !isFocused || this._isFocused ) { if ( !isFocused || this._isFocused ) {
return this; return this;

File diff suppressed because one or more lines are too long

View file

@ -255,7 +255,7 @@ proto.fireEvent = function ( type, event ) {
// focus event to fire after the blur event, which can cause an infinite // focus event to fire after the blur event, which can cause an infinite
// loop. So we detect whether we're actually focused/blurred before firing. // loop. So we detect whether we're actually focused/blurred before firing.
if ( /^(?:focus|blur)/.test( type ) ) { if ( /^(?:focus|blur)/.test( type ) ) {
isFocused = isOrContains( this._root, this._doc.activeElement ); isFocused = this._root === this._doc.activeElement;
if ( type === 'focus' ) { if ( type === 'focus' ) {
if ( !isFocused || this._isFocused ) { if ( !isFocused || this._isFocused ) {
return this; return this;