Skip to content
Draft
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,22 @@ class GuiControl {

buttonConfirm.off("click");

buttonConfirm.on("click", () => {
const confirmAction = () => {
dialog[0].close();
$(document).off("keydown.informationDialog");
resolve();
};

buttonConfirm.on("click", confirmAction);

// Add Enter key support for single-choice dialog
$(document).off("keydown.informationDialog");
$(document).on("keydown.informationDialog", (e) => {
// Only trigger if Enter key is pressed and target is not an input/textarea
if (e.which === 13 && !$(e.target).is("input, textarea")) {
e.preventDefault();
confirmAction();
}
});

dialog[0].showModal();
Expand Down