From ca3dccba12e7b32b688e5ea0ec53e2286a2ec929 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 12 May 2021 03:13:22 +0300 Subject: [PATCH] Settings: Do not scroll on color picker --- src/components/left/settings/SettingsGeneralBackgroundColor.scss | 1 + src/util/captureEvents.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/left/settings/SettingsGeneralBackgroundColor.scss b/src/components/left/settings/SettingsGeneralBackgroundColor.scss index ecd2406b..ae3da184 100644 --- a/src/components/left/settings/SettingsGeneralBackgroundColor.scss +++ b/src/components/left/settings/SettingsGeneralBackgroundColor.scss @@ -10,6 +10,7 @@ .color-picker { margin-top: 1rem; height: 12rem; + touch-action: none; } .hue-picker { diff --git a/src/util/captureEvents.ts b/src/util/captureEvents.ts index 6fd856e9..b5fedec2 100644 --- a/src/util/captureEvents.ts +++ b/src/util/captureEvents.ts @@ -122,6 +122,7 @@ export function captureEvents(element: HTMLElement, options: CaptureOptions) { } if (options.onDrag) { + e.preventDefault(); options.onDrag(e, captureEvent, { dragOffsetX, dragOffsetY }); }