Skip to content

Commit

Permalink
Only accept left clicks on control buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Aug 4, 2023
1 parent 8f738ab commit ff1d96e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/lib/ui/XTerm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,18 @@
TODO: This should be on:click, but that is not working due to the
containing element's on:pointerdown `stopPropagation()` call.
-->
<CircleButton kind="red" on:mousedown={() => dispatch("close")} />
<CircleButton kind="yellow" on:mousedown={() => dispatch("shrink")} />
<CircleButton kind="green" on:mousedown={() => dispatch("expand")} />
<CircleButton
kind="red"
on:mousedown={(event) => event.button === 0 && dispatch("close")}
/>
<CircleButton
kind="yellow"
on:mousedown={(event) => event.button === 0 && dispatch("shrink")}
/>
<CircleButton
kind="green"
on:mousedown={(event) => event.button === 0 && dispatch("expand")}
/>
</CircleButtons>
</div>
<div
Expand Down

0 comments on commit ff1d96e

Please sign in to comment.