mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
Fix context menu input field focus handling
This commit is contained in:
parent
4e2f7445ba
commit
24913d1a64
1 changed files with 4 additions and 1 deletions
|
@ -89,6 +89,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
let contextMenu: ContextMenu;
|
let contextMenu: ContextMenu;
|
||||||
const [onContextMenu, contextMenuItems] = setupContextMenu();
|
const [onContextMenu, contextMenuItems] = setupContextMenu();
|
||||||
|
let contextMenuInput: EditingInputAPI | null = null;
|
||||||
|
|
||||||
|
|
||||||
function quoteFontFamily(fontFamily: string): string {
|
function quoteFontFamily(fontFamily: string): string {
|
||||||
// generic families (e.g. sans-serif) must not be quoted
|
// generic families (e.g. sans-serif) must not be quoted
|
||||||
|
@ -1008,6 +1010,7 @@ components and functionality for general note editing.
|
||||||
role="presentation"
|
role="presentation"
|
||||||
bind:this={noteEditor}
|
bind:this={noteEditor}
|
||||||
on:contextmenu={(event) => {
|
on:contextmenu={(event) => {
|
||||||
|
contextMenuInput = $focusedInput;
|
||||||
onContextMenu(event, api, $focusedInput, contextMenu);
|
onContextMenu(event, api, $focusedInput, contextMenu);
|
||||||
}}
|
}}
|
||||||
on:dragover|preventDefault
|
on:dragover|preventDefault
|
||||||
|
@ -1196,7 +1199,7 @@ components and functionality for general note editing.
|
||||||
<Item
|
<Item
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
item.action();
|
item.action();
|
||||||
$focusedInput?.focus();
|
contextMenuInput?.focus();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
|
|
Loading…
Reference in a new issue