0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-30 16:41:20 -05:00

🐛 Fix problem with alt key measures being stuck

This commit is contained in:
alonso.torres 2025-01-17 12:30:27 +01:00
parent 4389750c54
commit 34a2a8815b
2 changed files with 8 additions and 0 deletions

View file

@ -17,6 +17,8 @@
### :bug: Bugs fixed ### :bug: Bugs fixed
- Fix problem with alt key measures being stuck [Taiga #9348](https://tree.taiga.io/project/penpot/issue/9348)
## 2.4.2 ## 2.4.2
### :bug: Bugs fixed ### :bug: Bugs fixed

View file

@ -976,6 +976,11 @@ Mousetrap.prototype.stopCallback = function (e, element, combo) {
return false; 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') { if ('composedPath' in e && typeof e.composedPath === 'function') {
// For open shadow trees, update `element` so that the following check works. // For open shadow trees, update `element` so that the following check works.
const initialEventTarget = e.composedPath()[0]; const initialEventTarget = e.composedPath()[0];
@ -990,6 +995,7 @@ Mousetrap.prototype.stopCallback = function (e, element, combo) {
element.tagName == "TEXTAREA" || element.tagName == "TEXTAREA" ||
(element.tagName == "BUTTON" && combo.includes("tab")) || (element.tagName == "BUTTON" && combo.includes("tab")) ||
(element.contentEditable && (element.contentEditable == "true" || element.contentEditable === "plaintext-only")); (element.contentEditable && (element.contentEditable == "true" || element.contentEditable === "plaintext-only"));
return shouldStop; return shouldStop;
} }