Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Fix missing argument onmouseup
Browse files Browse the repository at this point in the history
  • Loading branch information
xnkevinnguyen committed Feb 10, 2020
1 parent af56a1a commit cda4e75
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/view/components/microbit/MicrobitImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import "../../styles/Microbit.css";
import { MicrobitSvg } from "./Microbit_svg";

interface EventTriggers {
onMouseUp: (button: HTMLElement, event: Event, buttonKey: string) => void;
onMouseDown: (button: HTMLElement, event: Event, buttonKey: string) => void;
onMouseLeave: (
button: HTMLElement,
event: Event,
buttonKey: string
) => void;
onMouseUp: (event: Event, buttonKey: string) => void;
onMouseDown: (event: Event, buttonKey: string) => void;
onMouseLeave: (event: Event, buttonKey: string) => void;
}
interface IProps {
eventTriggers: EventTriggers;
Expand Down Expand Up @@ -47,13 +43,13 @@ const setupButton = (
key: string
) => {
buttonElement.onmousedown = e => {
eventTriggers.onMouseDown(buttonElement, e, key);
eventTriggers.onMouseDown(e, key);
};
buttonElement.onmouseup = e => {
eventTriggers.onMouseUp(buttonElement, e, key);
eventTriggers.onMouseUp(e, key);
};
buttonElement.onmouseleave = e => {
eventTriggers.onMouseLeave(buttonElement, e, key);
eventTriggers.onMouseLeave(e, key);
};
};
const setupAllButtons = (eventTriggers: EventTriggers, buttonRefs: Object) => {
Expand Down

0 comments on commit cda4e75

Please sign in to comment.