mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-11 13:26:16 +00:00
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { tick } from "svelte";
|
||||
import { onMount, tick } from "svelte";
|
||||
import { changes, ChangeType } from "$lib/undo-redo";
|
||||
import type { ChordInfo } from "$lib/undo-redo";
|
||||
import { scale } from "svelte/transition";
|
||||
@@ -11,6 +11,12 @@
|
||||
|
||||
export let chord: ChordInfo;
|
||||
|
||||
onMount(() => {
|
||||
if (chord.phrase.length === 0) {
|
||||
box.focus();
|
||||
}
|
||||
});
|
||||
|
||||
function keypress(event: KeyboardEvent) {
|
||||
if (event.key === "ArrowUp") {
|
||||
addSpecial(event);
|
||||
@@ -103,7 +109,6 @@
|
||||
<div
|
||||
on:keydown={keypress}
|
||||
on:mousedown={clickCursor}
|
||||
autofocus={chord.phrase.length === 0}
|
||||
role="textbox"
|
||||
tabindex="0"
|
||||
bind:this={box}
|
||||
|
||||
Reference in New Issue
Block a user