Skip to content

Commit

Permalink
Fix queue selection clearing on click
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Sep 27, 2024
1 parent 1f51c68 commit 74a24e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/Queue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
bind:this={queue_element}
class="content relative -mt-px border-l outline-none"
tabindex="-1"
on:mousedown|self={() => selection.clear()}
on:keydown={scroll_container_keydown}
on:keydown={(e) => {
if (check_shortcut(e, 'Backspace') && selection.items.size >= 1) {
Expand All @@ -193,7 +194,6 @@
selection.handle_keydown(e)
}
}}
on:mousedown|self={selection.clear}
>
{#if $queue.past.length || $queue.current}
<div class="relative">
Expand Down Expand Up @@ -281,7 +281,7 @@
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<h4
class="sticky top-0 z-1 flex h-[40px] items-center justify-between bg-black/50 px-7 font-semibold backdrop-blur-md"
on:mousedown|self={selection.clear}
on:mousedown|self={() => selection.clear()}
>
Up Next
{#if $queue.user_queue.length > 0}
Expand Down Expand Up @@ -343,7 +343,7 @@
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<h4
class="sticky top-0 z-1 flex h-[40px] items-center bg-black/50 px-7 font-semibold backdrop-blur-md"
on:mousedown={selection.clear}
on:mousedown={() => selection.clear()}
>
Autoplay
</h4>
Expand Down
4 changes: 2 additions & 2 deletions src/components/TrackList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@
<div
bind:this={scroll_container}
class="main-focus-element relative h-full overflow-y-auto outline-none"
on:keydown={keydown}
on:mousedown|self={() => selection.clear()}
tabindex="0"
on:mousedown|self={() => selection.clear()}
on:keydown={scroll_container_keydown}
on:keydown={keydown}
>
<VirtualListBlock
bind:this={virtual_list}
Expand Down

0 comments on commit 74a24e2

Please sign in to comment.