fix: scope shortcuts to textarea

This commit is contained in:
Xyphyn committed 2023-08-09 11:15:51 -07:00
1 parent 6c4b44357c
commit ffbb37e0df
2 files changed
+11 -13

No files matched your search

@@ -104,19 +104,6 @@
</Modal>
{/if}
<svelte:body
on:keydown={(e) => {
if (e.ctrlKey) {
// @ts-ignore
let shortcut = shortcuts[e.code]
if (shortcut) {
e.preventDefault()
shortcut?.()
}
}
}}
/>
<div>
{#if label}
<div class="block my-1 font-bold text-sm">{label}</div>
@@ -235,6 +222,16 @@ overflow-hidden focus-within:border-black focus-within:dark:border-white transit
class="bg-inherit border-0 rounded-none"
bind:value
bind:item={textArea}
on:keydown={(e) => {
if (e.ctrlKey) {
// @ts-ignore
let shortcut = shortcuts[e.code]
if (shortcut) {
e.preventDefault()
shortcut?.()
}
}
}}
{...$$restProps}
/>
{/if}