mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: Change shortcut listeners from window to document (#18416)
* fix: Change shortcut listeners to document * fix: split into window and document * chore: upgrade ui package
This commit is contained in:
parent
b2ef8ea7dd
commit
188188a844
25 changed files with 40 additions and 39 deletions
|
|
@ -1,9 +1,9 @@
|
|||
<script lang="ts">
|
||||
import Icon from '$lib/components/elements/icon.svelte';
|
||||
import { generateId } from '$lib/utils/generate-id';
|
||||
import { optionClickCallbackStore, selectedIdStore } from '$lib/stores/context-menu.store';
|
||||
import type { Shortcut } from '$lib/actions/shortcut';
|
||||
import { shortcutLabel as computeShortcutLabel, shortcut as bindShortcut } from '$lib/actions/shortcut';
|
||||
import { shortcut as bindShortcut, shortcutLabel as computeShortcutLabel } from '$lib/actions/shortcut';
|
||||
import Icon from '$lib/components/elements/icon.svelte';
|
||||
import { optionClickCallbackStore, selectedIdStore } from '$lib/stores/context-menu.store';
|
||||
import { generateId } from '$lib/utils/generate-id';
|
||||
|
||||
interface Props {
|
||||
text: string;
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
: () => {};
|
||||
</script>
|
||||
|
||||
<svelte:window use:bindShortcutIfSet />
|
||||
<svelte:document use:bindShortcutIfSet />
|
||||
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
onkeydown={onKeyDown}
|
||||
onkeyup={onKeyUp}
|
||||
onselectstart={onSelectStart}
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'Escape' }, onShortcut: onEscape },
|
||||
{ shortcut: { ctrl: true, key: 'k' }, onShortcut: () => input?.select() },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue