Skip to content

Commit c8f44bd

Browse files
Copilothaslinghuis
andcommitted
Add safety check to prevent Enter key on input/textarea elements
Co-authored-by: haslinghuis <[email protected]>
1 parent 50abdb4 commit c8f44bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/gui.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ class GuiControl {
392392
// Add Enter key support for single-choice dialog
393393
$(document).off("keydown.informationDialog");
394394
$(document).on("keydown.informationDialog", (e) => {
395-
if (e.which === 13) {
395+
// Only trigger if Enter key is pressed and target is not an input/textarea
396+
if (e.which === 13 && !$(e.target).is("input, textarea")) {
396397
e.preventDefault();
397398
confirmAction();
398399
}

0 commit comments

Comments
 (0)