Skip to content

Commit

Permalink
fix: touchstart handler should be passive
Browse files Browse the repository at this point in the history
  • Loading branch information
dairiki committed Oct 25, 2023
1 parent a31bdc5 commit cf73006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/tooldrawer/components/drag-handle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, state } from "lit/decorators.js";
import { customElement, eventOptions, state } from "lit/decorators.js";
import { WindowEventListenerController } from "./controllers/window-event-listener";

interface DragPosition {
Expand Down Expand Up @@ -84,9 +84,9 @@ export class DragHandle extends LitElement {
}
}

@eventOptions({ passive: true, capture: true })
private _ontouchstart(event: TouchEvent) {
if (event.targetTouches.length === 1) {
event.preventDefault();
/* eslint-disable @typescript-eslint/unbound-method */
this._windowEventListeners.add("touchmove", this._ontouchmove);
this._windowEventListeners.add("touchend", this._dragStop);
Expand Down

0 comments on commit cf73006

Please sign in to comment.