From 9b545151fa62f21a00e1cfa4fa711ddef0f07d62 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sat, 26 Oct 2024 02:08:49 -0700 Subject: [PATCH] Fix TJSGlassPane `wheel` event `preventDefault` warning. --- _dist/component/application/TJSGlassPane.svelte | 5 ++++- src/component/application/TJSGlassPane.svelte | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/_dist/component/application/TJSGlassPane.svelte b/_dist/component/application/TJSGlassPane.svelte index d7e4bd2..1df8651 100644 --- a/_dist/component/application/TJSGlassPane.svelte +++ b/_dist/component/application/TJSGlassPane.svelte @@ -122,7 +122,10 @@ if (captureInput) { - event.preventDefault(); + // `wheel` event types can't use `preventDefault` in capture / passive mode. + // see: https://chromestatus.com/feature/6662647093133312 + if (event?.type !== 'wheel') { event.preventDefault(); } + event.stopImmediatePropagation(); } diff --git a/src/component/application/TJSGlassPane.svelte b/src/component/application/TJSGlassPane.svelte index c6783b9..8fd1b3a 100644 --- a/src/component/application/TJSGlassPane.svelte +++ b/src/component/application/TJSGlassPane.svelte @@ -122,7 +122,10 @@ if (captureInput) { - event.preventDefault(); + // `wheel` event types can't use `preventDefault` in capture / passive mode. + // see: https://chromestatus.com/feature/6662647093133312 + if (event?.type !== 'wheel') { event.preventDefault(); } + event.stopImmediatePropagation(); }