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