From 91558ad9ea7c4a6c50eab73b53492965b9cc8fa4 Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Fri, 12 Apr 2024 20:49:55 -0400 Subject: [PATCH 1/2] add enter to submit on input type --- public/scripts/popup.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/scripts/popup.js b/public/scripts/popup.js index b793f3a66..03ca81e8c 100644 --- a/public/scripts/popup.js +++ b/public/scripts/popup.js @@ -107,6 +107,13 @@ export class Popup { // illegal argument } + this.input.addEventListener('keydown', (evt)=>{ + if (evt.key != 'Enter' || evt.altKey || evt.ctrlKey || evt.shiftKey) return; + evt.preventDefault(); + evt.stopPropagation(); + this.completeAffirmative(); + }); + this.ok.addEventListener('click', ()=>this.completeAffirmative()); this.cancel.addEventListener('click', ()=>this.completeNegative()); const keyListener = (evt)=>{ From 278ec029f5afc123ea15d95a47fb2ed5cdaf5298 Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Fri, 12 Apr 2024 20:50:14 -0400 Subject: [PATCH 2/2] add missing cancelButton setting to callGenericPopup --- public/scripts/popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/popup.js b/public/scripts/popup.js index 03ca81e8c..217991611 100644 --- a/public/scripts/popup.js +++ b/public/scripts/popup.js @@ -226,7 +226,7 @@ export function callGenericPopup(text, type, inputValue = '', { okButton, cancel text, type, inputValue, - { okButton, rows, wide, large, allowHorizontalScrolling, allowVerticalScrolling }, + { okButton, cancelButton, rows, wide, large, allowHorizontalScrolling, allowVerticalScrolling }, ); return popup.show(); }