-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear the correct button when right-clicking
- Loading branch information
1 parent
99127a7
commit ba94985
Showing
3 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<script lang="ts"> | ||
export let number = 0; | ||
export let onKeypadInput: (input: string) => void = () => {}; | ||
export let clearNumber: (input: number) => void = () => {}; | ||
</script> | ||
|
||
<button | ||
class="btn" | ||
data-value="{number}" | ||
on:click="{() => onKeypadInput(number.toString())}" | ||
on:contextmenu|preventDefault="{() => onKeypadInput('Backspace')}" | ||
on:contextmenu|preventDefault="{() => clearNumber(number)}" | ||
> | ||
{number} | ||
</button> |