From 36930f1138508c73b979c2be9666fc35df92c8ac Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 14 Nov 2023 00:38:40 +0530 Subject: [PATCH] Fix `Esc` instantly killing the comment submission box when there's text in it in the site template. --- site/static/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/static/main.js b/site/static/main.js index e2ca480..a588dcd 100644 --- a/site/static/main.js +++ b/site/static/main.js @@ -126,7 +126,7 @@ const txt = form.querySelector("textarea"); txt.focus(); txt.onkeydown = (e) => { - if (e.key === "Escape") { + if (e.key === "Escape" && txt.value === "") { btn.close(); } };