mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
Fire focus or blur event manually in focus/blur method for MSIE because
MSIE invoke focus/blur event listener asynchronously
This commit is contained in:
parent
df9b5add68
commit
96b03d4aaf
2 changed files with 11 additions and 0 deletions
|
@ -34,6 +34,7 @@ var isIElt11 = /Trident\/[456]\./.test( ua );
|
||||||
var isPresto = !!win.opera;
|
var isPresto = !!win.opera;
|
||||||
var isEdge = /Edge\//.test( ua );
|
var isEdge = /Edge\//.test( ua );
|
||||||
var isWebKit = !isEdge && /WebKit\//.test( ua );
|
var isWebKit = !isEdge && /WebKit\//.test( ua );
|
||||||
|
var isIE = /MSIE/.test( ua );
|
||||||
|
|
||||||
var ctrlKey = isMac ? 'meta-' : 'ctrl-';
|
var ctrlKey = isMac ? 'meta-' : 'ctrl-';
|
||||||
|
|
||||||
|
|
|
@ -619,11 +619,21 @@ proto._updatePathOnEvent = function () {
|
||||||
|
|
||||||
proto.focus = function () {
|
proto.focus = function () {
|
||||||
this._root.focus();
|
this._root.focus();
|
||||||
|
|
||||||
|
if ( isIE ) {
|
||||||
|
this.fireEvent( 'focus' );
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
proto.blur = function () {
|
proto.blur = function () {
|
||||||
this._root.blur();
|
this._root.blur();
|
||||||
|
|
||||||
|
if ( isIE ) {
|
||||||
|
this.fireEvent( 'blur' );
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue