Fix: Menu shortcut while focused in iframe

This commit is contained in:
Luc Mcgrady 2025-11-19 20:26:50 +00:00
parent 9edde37ce1
commit 98c618a048
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C

View file

@ -113,7 +113,9 @@ export class ReviewerState {
break;
}
case "keypress": {
document.dispatchEvent(new KeyboardEvent("keydown", e.data.eventInit));
// This is a hacky fix because otherwise while focused on the reviewer-bottom, pressing m only keeps the menu open for the duration of the button press (using "keyup" in the shortcut in More.svelte fixed this)
const forceKeyUp = e.data.eventInit.key?.toLowerCase() == "m";
document.dispatchEvent(new KeyboardEvent(forceKeyUp ? "keyup" : "keydown", e.data.eventInit));
break;
}
case "setstorage": {