DEV: Update Mousetrap to 1.6.3

DEV: Update Mousetrap to 1.6.3

diff --git a/package.json b/package.json
index 149959a..7f03ece 100644
--- a/package.json
+++ b/package.json
@@ -9,8 +9,8 @@
     "@fortawesome/fontawesome-free": "5.7.2",
     "ace-builds": "1.4.2",
     "bootbox": "3.2.0",
-    "chart.js": "2.7.3",
     "bootstrap": "v3.4.1",
+    "chart.js": "2.7.3",
     "favcount": "https://github.com/chrishunt/favcount",
     "handlebars": "4.0.12",
     "highlight.js": "https://github.com/highlightjs/highlight.js",
diff --git a/vendor/assets/javascripts/mousetrap.js b/vendor/assets/javascripts/mousetrap.js
index 162d5b9..0479677 100644
--- a/vendor/assets/javascripts/mousetrap.js
+++ b/vendor/assets/javascripts/mousetrap.js
@@ -17,7 +17,7 @@
  * Mousetrap is a simple keyboard shortcut library for Javascript with
  * no external dependencies
  *
- * @version 1.6.2
+ * @version 1.6.3
  * @url craig.is/killing/mice
  */
 (function(window, document, undefined) {
@@ -982,6 +982,20 @@
             return false;
         }
 
+        // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
+        // not the initial event target in the shadow tree. Note that not all events cross the
+        // shadow boundary.
+        // For shadow trees with `mode: 'open'`, the initial event target is the first element in
+        // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
+        // target cannot be obtained.
+        if ('composedPath' in e && typeof e.composedPath === 'function') {
+            // For open shadow trees, update `element` so that the following check works.
+            var initialEventTarget = e.composedPath()[0];
+            if (initialEventTarget !== e.target) {
+                element = initialEventTarget;
+            }
+        }
+
         // stop for input, select, and textarea
         return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
     };
diff --git a/yarn.lock b/yarn.lock
index a57ab9d..7de8a2a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1646,8 +1646,8 @@ moment@2.x, moment@^2.10.2:
   integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
 
 "mousetrap@https://github.com/discourse/mousetrap#firefox-alt-key":
-  version "1.6.2"
-  resolved "https://github.com/discourse/mousetrap#51613787a7cb8be79435f039ba2ba3a43efe797d"
+  version "1.6.3"
+  resolved "https://github.com/discourse/mousetrap#0d41aa7b173abfb83a6bec3ad39a6a708bc49108"
 
 ms@2.0.0:
   version "2.0.0"

GitHub sha: 44523320

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there:

Would have been nice to get the reason why we updated that dependency in the commit message :wink:

2 Likes