diff --git a/CHANGES.md b/CHANGES.md index 7033dabc8..08248554e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,8 @@ ### :bug: Bugs fixed +- Fix problem with alt key measures being stuck [Taiga #9348](https://tree.taiga.io/project/penpot/issue/9348) + ## 2.4.2 ### :bug: Bugs fixed diff --git a/frontend/vendor/mousetrap/index.js b/frontend/vendor/mousetrap/index.js index 0dd2e96b3..c1cd8af3d 100644 --- a/frontend/vendor/mousetrap/index.js +++ b/frontend/vendor/mousetrap/index.js @@ -976,6 +976,11 @@ Mousetrap.prototype.stopCallback = function (e, element, combo) { return false; } + // Keyup events need to be dispatched always. Otherwise some events can be stuck + if (e.type == 'keyup') { + return false; + } + if ('composedPath' in e && typeof e.composedPath === 'function') { // For open shadow trees, update `element` so that the following check works. const initialEventTarget = e.composedPath()[0]; @@ -990,6 +995,7 @@ Mousetrap.prototype.stopCallback = function (e, element, combo) { element.tagName == "TEXTAREA" || (element.tagName == "BUTTON" && combo.includes("tab")) || (element.contentEditable && (element.contentEditable == "true" || element.contentEditable === "plaintext-only")); + return shouldStop; }