Fix: Check for focus with inner iframe keypress

This commit is contained in:
Luc Mcgrady 2025-10-31 17:32:50 +00:00
parent dae91bd1d8
commit 4e8bf13813
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C

View file

@ -58,7 +58,12 @@ addEventListener("message", async (e: MessageEvent<InnerReviewerRequest>) => {
});
addEventListener("keydown", (e) => {
if (e.key.length == 1 && "1234 ".includes(e.key) && !document.activeElement?.matches("#typeans")) {
if (e.key === "Enter" && document.activeElement?.matches("#typeans")) {
postParentMessage({ type: "keypress", key: " " });
} else if (
e.key.length == 1 && "1234 ".includes(e.key)
&& !document.activeElement?.matches("input[type=text], input[type=number], textarea")
) {
postParentMessage({ type: "keypress", key: e.key });
}
});