diff --git a/src/mixins/canvas_events.mixin.ts b/src/mixins/canvas_events.mixin.ts index 865604158ae..3c7f2987d2d 100644 --- a/src/mixins/canvas_events.mixin.ts +++ b/src/mixins/canvas_events.mixin.ts @@ -158,14 +158,6 @@ nestedTarget && nestedTarget.fire('mouseout', { e: e }); }, this); this._hoveredTargets = []; - - if (this._iTextInstances) { - this._iTextInstances.forEach(function(obj) { - if (obj.isEditing) { - obj.hiddenTextarea.focus(); - } - }); - } }, /** diff --git a/src/mixins/itext_behavior.mixin.ts b/src/mixins/itext_behavior.mixin.ts index d2d1c3109f8..fee13429c31 100644 --- a/src/mixins/itext_behavior.mixin.ts +++ b/src/mixins/itext_behavior.mixin.ts @@ -398,6 +398,9 @@ import { removeFromArray } from '../util/internals'; return; } + // regain focus + document.activeElement !== this.hiddenTextarea && this.hiddenTextarea.focus(); + var newSelectionStart = this.getSelectionStartFromPointer(options.e), currentStart = this.selectionStart, currentEnd = this.selectionEnd;