From 2710f7fc25ace8970c11019878d11546ae283962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Fri, 10 Nov 2023 16:00:34 +0100 Subject: [PATCH] fix: phrase insert button not working --- src/routes/config/chords/ChordPhraseEdit.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/routes/config/chords/ChordPhraseEdit.svelte b/src/routes/config/chords/ChordPhraseEdit.svelte index a34262ce..ec2e7622 100644 --- a/src/routes/config/chords/ChordPhraseEdit.svelte +++ b/src/routes/config/chords/ChordPhraseEdit.svelte @@ -60,8 +60,9 @@ }) } - function clickCursor(event: unknown) { - const distance = (event as {layerX: number}).layerX + function clickCursor(event: MouseEvent) { + if (event.target === button) return + const distance = (event as unknown as {layerX: number}).layerX let i = 0 for (const child of box.children) { @@ -136,7 +137,9 @@ bind:this={box} class:edited={chord.phraseChanged} on:focusin={() => (hasFocus = true)} - on:focusout={() => (hasFocus = false)} + on:focusout={event => { + if (event.relatedTarget !== button) hasFocus = false + }} > {#if hasFocus}