mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 03:53:55 -05:00
Fix: Menu shortcut while focused in iframe
This commit is contained in:
parent
9edde37ce1
commit
98c618a048
1 changed files with 3 additions and 1 deletions
|
|
@ -113,7 +113,9 @@ export class ReviewerState {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "keypress": {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case "setstorage": {
|
case "setstorage": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue