Skip to content

Commit

Permalink
fix #709
Browse files Browse the repository at this point in the history
if we do not update on mouseleave user could start a drag inside editor
and end it outside, which will not trigger mouseup since it is not on
the editor, thus we need to update on mosueleave. Earlier this was
removed because of issues with Bubble but those issues are also and
better fixed with preventDefault on mousedown on a button, instead of
click
  • Loading branch information
jhchen committed May 30, 2016
1 parent 4981423 commit b25fad6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Selection {
this.cursor = Parchment.create('cursor', this);
// savedRange is last non-null range
this.lastRange = this.savedRange = new Range(0, 0);
['keyup', 'mouseup', 'touchend', 'touchleave', 'focus', 'blur'].forEach((eventName) => {
['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach((eventName) => {
this.root.addEventListener(eventName, () => {
// When range used to be a selection and user click within the selection,
// the range now being a cursor has not updated yet without setTimeout
Expand Down

0 comments on commit b25fad6

Please sign in to comment.