We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8189614 commit 4e1856bCopy full SHA for 4e1856b
src/RightClickCancelSensor.tsx
@@ -18,12 +18,16 @@ export class RightClickCancelSensor extends PointerSensor {
18
19
constructor(props: PointerSensorProps) {
20
super(props);
21
- window.addEventListener('contextmenu', this.handleContextMenu, {
22
- passive: false,
23
- });
+ if (typeof window !== 'undefined') {
+ window.addEventListener('contextmenu', this.handleContextMenu, {
+ passive: false,
24
+ });
25
+ }
26
}
27
28
teardown() {
- window.removeEventListener('contextmenu', this.handleContextMenu);
29
30
+ window.removeEventListener('contextmenu', this.handleContextMenu);
31
32
33
0 commit comments