Skip to content

Commit 6a8afe1

Browse files
committed
format
1 parent 62ccd6f commit 6a8afe1

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/wplace-bot-manager.user.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,21 @@
593593
// Keyboard for inline panel
594594
function onKeyDown(e) {
595595
// Check if we're dealing with shadow DOM retargeting
596-
const actualTarget = e.composedPath ? e.composedPath()[0] : e.target;
597-
const actualTag = (actualTarget && actualTarget.tagName || '').toUpperCase();
598-
596+
const actualTarget = e.composedPath
597+
? e.composedPath()[0]
598+
: e.target;
599+
const actualTag = (
600+
(actualTarget && actualTarget.tagName) ||
601+
''
602+
).toUpperCase();
603+
599604
// Always allow ESC to close
600605
if (e.key === 'Escape') {
601606
close();
602607
e.preventDefault();
603608
return;
604609
}
605-
610+
606611
// Don't trigger hotkeys when typing in input fields anywhere
607612
// Use actualTag to check the real target element
608613
if (
@@ -612,7 +617,7 @@
612617
) {
613618
return;
614619
}
615-
620+
616621
// Only handle numeric hotkeys when not in an input field
617622
if (e.key >= '0' && e.key <= '9') {
618623
const items = sortedScripts();
@@ -755,4 +760,4 @@
755760
}, 1000);
756761
}
757762
}
758-
})();
763+
})();

0 commit comments

Comments
 (0)