Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-09-07 21:32:30 +02:00 committed by GitHub
parent 1af17e771b
commit 819064d2c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -374,10 +374,10 @@ export class MoveTouchControlsHandler {
// Remove event listeners
const { pointerdown, pointermove, pointerup } = this.configurationEventListeners;
this.getControlGroupElements().forEach((element, index) =>
element.removeEventListener("touchstart", pointerdown[index]),
element.removeEventListener("pointerdown", pointerdown[index]),
);
pointermove.forEach(listener => window.removeEventListener("touchmove", listener));
pointerup.forEach(listener => window.removeEventListener("touchend", listener));
pointermove.forEach(listener => window.removeEventListener("pointermove", listener));
pointerup.forEach(listener => window.removeEventListener("pointerup", listener));
// Remove configuration toolbar
const toolbar = document.querySelector("#touchControls #configToolbar");