diff --git a/src/Context.svelte.ts b/src/Context.svelte.ts index 0128141..fdc1f0d 100644 --- a/src/Context.svelte.ts +++ b/src/Context.svelte.ts @@ -190,6 +190,7 @@ export class Context { } public finishReparenting(newParentId: TaskId) { + this.pressedButtonCode = -1; if (this.reparentingTaskId == NoTaskId) { throw new Error("Incorrect state: reparentingTaskId expected"); } diff --git a/src/components/Button.svelte b/src/components/Button.svelte index 04fda53..756b5e5 100644 --- a/src/components/Button.svelte +++ b/src/components/Button.svelte @@ -69,12 +69,10 @@ } if (isPressed) { // pressed the same button a second time - isPressed = false; context.pressedButtonCode = -1; return; } else if (stateful) { // pressed a stateful button - isPressed = true; context.pressedButtonCode = iconCode; } else { // pressed a stateless button @@ -98,7 +96,6 @@ context.chosenBlockerId = context.chosenBlockerId === NoTaskId ? context.selectedTaskId : NoTaskId; } } - let classString = $derived(` ${(isPressed && !isButtonDisabled) ? 'is-pressed-up ': ''} ${(isPressedDown && !isButtonDisabled) ? 'is-pressed-down ': '' } diff --git a/src/components/Task.svelte b/src/components/Task.svelte index 556daf2..3723178 100644 --- a/src/components/Task.svelte +++ b/src/components/Task.svelte @@ -92,6 +92,7 @@ else if (context.isReparentingOn()) { if (context.isValidReparentingTarget(taskId)) { context.finishReparenting(taskId); + context.cancelReparenting(); } } else { context.pressedButtonCode = -1;