From ea83e45942a63fed7dc5828d6b89f2e1d3dc08bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mitja=20Bezen=C5=A1ek?= Date: Wed, 6 Dec 2023 17:19:31 +0100 Subject: [PATCH] Fix the cleanup of event handlers (#2298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We probably don't want to add the listener here. ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version --- .../src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts b/packages/editor/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts index 658963086..7b64f69cf 100644 --- a/packages/editor/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +++ b/packages/editor/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts @@ -38,7 +38,7 @@ export function useFixSafariDoubleTapZoomPencilEvents(ref: React.RefObject { elm.removeEventListener('touchstart', handleEvent) - elm.addEventListener('touchend', handleEvent) + elm.removeEventListener('touchend', handleEvent) } }, [editor, ref]) }