mirror of
https://github.com/fastmail/Squire.git
synced 2025-03-11 15:11:23 -05:00
Ignore selectionchange events outside of editor
The selectionchange event handler can only be registered on the document but we are not interested in changes of focus/selection that happen outside of the editor, so check we have focus before firing the update path event.
This commit is contained in:
parent
a8f07d9adb
commit
0b59a746f7
1 changed files with 2 additions and 2 deletions
|
@ -617,9 +617,9 @@ proto._updatePath = function ( range, force ) {
|
||||||
// selectionchange is fired synchronously in IE when removing current selection
|
// selectionchange is fired synchronously in IE when removing current selection
|
||||||
// and when setting new selection; keyup/mouseup may have processing we want
|
// and when setting new selection; keyup/mouseup may have processing we want
|
||||||
// to do first. Either way, send to next event loop.
|
// to do first. Either way, send to next event loop.
|
||||||
proto._updatePathOnEvent = function () {
|
proto._updatePathOnEvent = function ( event ) {
|
||||||
var self = this;
|
var self = this;
|
||||||
if ( !self._willUpdatePath ) {
|
if ( self._isFocused && !self._willUpdatePath ) {
|
||||||
self._willUpdatePath = true;
|
self._willUpdatePath = true;
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
self._willUpdatePath = false;
|
self._willUpdatePath = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue