fix(web): keyboard shortcut handling (#7946)

* fix(web): keyboard shortcut handling

* drop executeShortcuts in favor of action

* fix merge

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Michel Heusschen
2024-03-15 00:16:55 +01:00
committed by GitHub
parent 12fb90c232
commit eed8e6b67a
14 changed files with 197 additions and 268 deletions

View File

@@ -2,6 +2,7 @@
import { autoGrowHeight } from '$lib/utils/autogrow';
import { updateAlbumInfo } from '@immich/sdk';
import { handleError } from '$lib/utils/handle-error';
import { shortcut } from '$lib/utils/shortcut';
export let id: string;
export let description: string;
@@ -37,6 +38,10 @@
on:focusout={handleUpdateDescription}
use:autoGrowHeight
placeholder="Add description"
use:shortcut={{
shortcut: { key: 'Enter', ctrl: true },
onShortcut: (e) => e.currentTarget.blur(),
}}
/>
{:else if description}
<p class="break-words whitespace-pre-line w-full text-black dark:text-white text-base">