Skip to content

Commit

Permalink
Move the activeElement check to the base editor
Browse files Browse the repository at this point in the history
  • Loading branch information
jansiegel committed Nov 18, 2015
1 parent 7029ca3 commit 8ad53a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1170,12 +1170,6 @@ Handsontable.Core = function Core(rootElement, userSettings) {
*/
this.listen = function() {
Handsontable.activeGuid = instance.guid;

if (document.activeElement && document.activeElement !== document.body) {
document.activeElement.blur();
} else if (!document.activeElement) { //IE
document.body.focus();
}
};

/**
Expand Down
6 changes: 6 additions & 0 deletions src/editors/_baseEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ BaseEditor.prototype.prepare = function(row, col, prop, td, originalValue, cellP
this.originalValue = originalValue;
this.cellProperties = cellProperties;

if (this.instance.view.isMouseDown() && document.activeElement && document.activeElement !== document.body) {
document.activeElement.blur();
} else if (!document.activeElement) { //IE
document.body.focus();
}

this.state = Handsontable.EditorState.VIRGIN;
};

Expand Down

0 comments on commit 8ad53a9

Please sign in to comment.