Skip to content

Commit

Permalink
Fix Esc instantly killing the comment submission box when there's t…
Browse files Browse the repository at this point in the history
…ext in it in the site template.
  • Loading branch information
knadh committed Nov 13, 2023
1 parent 217a832 commit 36930f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
};
Expand Down

0 comments on commit 36930f1

Please sign in to comment.