Skip to content
This repository was archived by the owner on Feb 11, 2021. It is now read-only.

Commit a9d1b71

Browse files
committed
Mouse: Recover after out of document mouseup
Fixes gh-279 Closes gh-297
1 parent b7a47c9 commit a9d1b71

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/mouse.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ var mouseEvents = {
6363
},
6464
prepareButtonsForMove: function(e, inEvent) {
6565
var p = pointermap.get(this.POINTER_ID);
66-
e.buttons = p ? p.buttons : 0;
66+
67+
// Update buttons state after possible out-of-document mouseup.
68+
if (inEvent.which === 0 || !p) {
69+
e.buttons = 0;
70+
} else {
71+
e.buttons = p.buttons;
72+
}
6773
inEvent.buttons = e.buttons;
6874
},
6975
mousedown: function(inEvent) {

0 commit comments

Comments
 (0)