fix: scope shortcuts to textarea
This commit is contained in:
1 parent
6c4b44357c
commit
ffbb37e0df
2 files changed
+11
-13
No files matched your search
@@ -30,6 +30,7 @@
|
||||
bind:value
|
||||
bind:this={item}
|
||||
on:input={(e) => dispatcher('input', e)}
|
||||
on:keydown
|
||||
{placeholder}
|
||||
{maxlength}
|
||||
{rows}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user