Skip to content

Commit

Permalink
fix(): regain focus on mouse move (#8179)
Browse files Browse the repository at this point in the history
fixes #8177 caused by #3759
and fixes #3661 that was the motivation for #3759

This issue was caused because the hiddenTextarea looses focus after mousedown.
So I have added a focus call in mousemove that fixes both issues.
  • Loading branch information
ShaMan123 authored Aug 25, 2022
1 parent 2b2ddab commit cb4dd79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/mixins/canvas_events.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
}
},

/**
Expand Down
3 changes: 3 additions & 0 deletions src/mixins/itext_behavior.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cb4dd79

Please sign in to comment.