mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-10 12:02:48 +00:00
fix: phrase insert button not working
This commit is contained in:
@@ -60,8 +60,9 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickCursor(event: unknown) {
|
function clickCursor(event: MouseEvent) {
|
||||||
const distance = (event as {layerX: number}).layerX
|
if (event.target === button) return
|
||||||
|
const distance = (event as unknown as {layerX: number}).layerX
|
||||||
|
|
||||||
let i = 0
|
let i = 0
|
||||||
for (const child of box.children) {
|
for (const child of box.children) {
|
||||||
@@ -136,7 +137,9 @@
|
|||||||
bind:this={box}
|
bind:this={box}
|
||||||
class:edited={chord.phraseChanged}
|
class:edited={chord.phraseChanged}
|
||||||
on:focusin={() => (hasFocus = true)}
|
on:focusin={() => (hasFocus = true)}
|
||||||
on:focusout={() => (hasFocus = false)}
|
on:focusout={event => {
|
||||||
|
if (event.relatedTarget !== button) hasFocus = false
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{#if hasFocus}
|
{#if hasFocus}
|
||||||
<div transition:scale class="cursor" style:translate="{cursorOffset}px 0">
|
<div transition:scale class="cursor" style:translate="{cursorOffset}px 0">
|
||||||
|
|||||||
Reference in New Issue
Block a user