Skip to content

Commit

Permalink
fix mouseup when dragged off of grid
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrude committed Jul 21, 2023
1 parent 13dd728 commit c28c366
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/components/ClueGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
return false;
};
export const onDragEnd = (event: MouseEvent, i: number, j: number) => {
export const onDragEnd = (event: MouseEvent) => {
if (!mouseDragging) {
return;
}
Expand Down Expand Up @@ -541,7 +541,7 @@
};
</script>

<svelte:window on:keydown={onKeyDown} />
<svelte:window on:keydown={onKeyDown} on:mouseup={onDragEnd} />

<!-- <div class="grid-current-clue">{currentClue}</div> -->

Expand Down Expand Up @@ -631,7 +631,6 @@
on:click={() => highlight(i, j, true)}
on:mousedown={(event) => onDragStart(event, i, j)}
on:mouseenter={(event) => onDragOver(event, i, j)}
on:mouseup={(event) => onDragEnd(event, i, j)}
>
{puzzle.grid[i][j].text}
</div>
Expand Down

0 comments on commit c28c366

Please sign in to comment.