0
Fork 0
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:
Sungho Kim 2016-07-27 16:15:42 +09:00
parent df9b5add68
commit 96b03d4aaf
2 changed files with 11 additions and 0 deletions

View file

@ -34,6 +34,7 @@ var isIElt11 = /Trident\/[456]\./.test( ua );
var isPresto = !!win.opera;
var isEdge = /Edge\//.test( ua );
var isWebKit = !isEdge && /WebKit\//.test( ua );
var isIE = /MSIE/.test( ua );
var ctrlKey = isMac ? 'meta-' : 'ctrl-';

View file

@ -619,11 +619,21 @@ proto._updatePathOnEvent = function () {
proto.focus = function () {
this._root.focus();
if ( isIE ) {
this.fireEvent( 'focus' );
}
return this;
};
proto.blur = function () {
this._root.blur();
if ( isIE ) {
this.fireEvent( 'blur' );
}
return this;
};