Skip to content

Commit

Permalink
fix pointer transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
OrionReed committed Dec 3, 2024
1 parent 32a36a1 commit 5a4c4b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/folk-shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ export class FolkShape extends HTMLElement {
// ignore interactions from slotted elements.
if (target !== this && !target.hasAttribute('part')) return;

this.addEventListener('pointermove', this);
this.addEventListener('lostpointercapture', this);
target.addEventListener('pointermove', this);
target.addEventListener('lostpointercapture', this);
target.setPointerCapture(event.pointerId);

const interaction = target.getAttribute('part') || 'move';
Expand Down Expand Up @@ -553,8 +553,8 @@ export class FolkShape extends HTMLElement {
const target = event.composedPath()[0] as HTMLElement;
const interaction = target.getAttribute('part') || 'move';
this.#internals.states.delete(interaction);
this.removeEventListener('pointermove', this);
this.removeEventListener('lostpointercapture', this);
target.removeEventListener('pointermove', this);
target.removeEventListener('lostpointercapture', this);

this.#updateCursors();
if (target.getAttribute('part')?.startsWith('rotation')) {
Expand Down

0 comments on commit 5a4c4b1

Please sign in to comment.