Skip to content

Commit

Permalink
Add missing isKeyboardEvent helper (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic authored Nov 22, 2021
1 parent 1c6369e commit 1e359e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/sensors/keyboard/KeyboardSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
subtract as getCoordinatesDelta,
getOwnerDocument,
getWindow,
isKeyboardEvent,
} from '@dnd-kit/utilities';

import type {Coordinates} from '../../types';
Expand Down Expand Up @@ -79,7 +80,7 @@ export class KeyboardSensor implements SensorInstance {
}

private handleKeyDown(event: Event) {
if (event instanceof KeyboardEvent) {
if (isKeyboardEvent(event)) {
const {coordinates} = this;
const {active, context, options} = this.props;
const {
Expand Down

0 comments on commit 1e359e6

Please sign in to comment.