Skip to content

Commit

Permalink
fix: Use .key instead of .which unicorn/prefer-keyboard-event-key
Browse files Browse the repository at this point in the history
  • Loading branch information
csouchet committed Aug 29, 2023
1 parent d7720b2 commit ec2464d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dev/ts/shared/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ function showMousePointer(): void {
'mousedown',
event => {
updateButtons(event.buttons);
box.classList.add('button-' + event.which);
// eslint-disable-next-line unicorn/prefer-keyboard-event-key -- 'key' doesn't exist
box.classList.add(`button-${event.which}`);
},
true,
);
document.addEventListener(
'mouseup',
event => {
updateButtons(event.buttons);
box.classList.remove('button-' + event.which);
// eslint-disable-next-line unicorn/prefer-keyboard-event-key -- 'key' doesn't exist
box.classList.remove(`button-${event.which}`);
},
true,
);
Expand Down

0 comments on commit ec2464d

Please sign in to comment.