Skip to content

Commit

Permalink
fix: modifier-only key observers not working (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara authored May 4, 2022
1 parent 43d94fb commit c7e849a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/Services/IOService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class IOService {

private eventMatchesKeyAndModifiers(
event: KeyboardEvent,
key: KeyboardKey | string,
key: KeyboardKey | string | undefined,
modifiers: KeyboardModifier[] = [],
): boolean {
const eventModifiers = this.modifiersForEvent(event)
Expand Down Expand Up @@ -186,7 +186,7 @@ export class IOService {
continue
}

if (observer.key && this.eventMatchesKeyAndModifiers(event, observer.key, observer.modifiers)) {
if (this.eventMatchesKeyAndModifiers(event, observer.key, observer.modifiers)) {
const callback = keyEvent === KeyboardKeyEvent.Down ? observer.onKeyDown : observer.onKeyUp
if (callback) {
callback(event)
Expand Down

0 comments on commit c7e849a

Please sign in to comment.