From 91558ad9ea7c4a6c50eab73b53492965b9cc8fa4 Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Fri, 12 Apr 2024 20:49:55 -0400 Subject: [PATCH] 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)=>{