From 319d27f0c07eaea13d14750f118c649c825d03dd Mon Sep 17 00:00:00 2001
From: larissasmith <smithl@familysearch.org>
Date: Fri, 16 Jun 2017 14:05:35 -0600
Subject: [PATCH] Fix image stuck to mouse when right-clicking and
 left-clicking simultaneously. Mouseup and mousedown events are lost when two
 buttons are pressed at the same time. Pressing buttons in the order
 left-button down, right-button down (ignored), left-button up (ignored),
 right-button up was leaving drag state active.

---
 src/mousetracker.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mousetracker.js b/src/mousetracker.js
index 3dbcf595..5887f4aa 100644
--- a/src/mousetracker.js
+++ b/src/mousetracker.js
@@ -2879,6 +2879,12 @@
                 }
             }
 
+            // A primary mouse button may have been released while the non-primary button was down
+            if (pointsList.contacts > 0 && pointsList.type === 'mouse') {
+                // Stop tracking the mouse
+                pointsList.contacts--;
+                return true;
+            }
             return false;
         }