From d668591d6eea5d6aa211e9192537ee5ce4887754 Mon Sep 17 00:00:00 2001 From: Mateusz Kalinowski Date: Wed, 7 May 2025 16:30:03 +0200 Subject: [PATCH] fix(ColorPicker): make thumbs touch draggable --- src/theme/color-picker.ts | 4 +- .../ColorPicker-vue.spec.ts.snap | 56 +++++++++---------- .../__snapshots__/ColorPicker.spec.ts.snap | 56 +++++++++---------- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/theme/color-picker.ts b/src/theme/color-picker.ts index 33c4e7e69a..2943fdc16d 100644 --- a/src/theme/color-picker.ts +++ b/src/theme/color-picker.ts @@ -2,10 +2,10 @@ export default { slots: { root: 'data-[disabled]:opacity-75', picker: 'flex gap-4', - selector: 'rounded-md', + selector: 'rounded-md touch-none', selectorBackground: 'w-full h-full relative rounded-md', selectorThumb: '-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-(--color-white) rounded-full cursor-pointer data-[disabled]:cursor-not-allowed', - track: 'w-[8px] relative rounded-md', + track: 'w-[8px] relative rounded-md touch-none', trackThumb: 'absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-(--color-white) cursor-pointer data-[disabled]:cursor-not-allowed' }, variants: { diff --git a/test/components/__snapshots__/ColorPicker-vue.spec.ts.snap b/test/components/__snapshots__/ColorPicker-vue.spec.ts.snap index 23223b78f1..715bde87d9 100644 --- a/test/components/__snapshots__/ColorPicker-vue.spec.ts.snap +++ b/test/components/__snapshots__/ColorPicker-vue.spec.ts.snap @@ -3,12 +3,12 @@ exports[`ColorPicker > renders with as correctly 1`] = ` "
-
+
-
+
@@ -18,12 +18,12 @@ exports[`ColorPicker > renders with as correctly 1`] = ` exports[`ColorPicker > renders with class correctly 1`] = ` "
-
+
-
+
@@ -33,12 +33,12 @@ exports[`ColorPicker > renders with class correctly 1`] = ` exports[`ColorPicker > renders with disabled correctly 1`] = ` "
-
+
-
+
@@ -48,12 +48,12 @@ exports[`ColorPicker > renders with disabled correctly 1`] = ` exports[`ColorPicker > renders with format cmyk correctly 1`] = ` "
-
+
-
+
@@ -63,12 +63,12 @@ exports[`ColorPicker > renders with format cmyk correctly 1`] = ` exports[`ColorPicker > renders with format hex correctly 1`] = ` "
-
+
-
+
@@ -78,12 +78,12 @@ exports[`ColorPicker > renders with format hex correctly 1`] = ` exports[`ColorPicker > renders with format hsl correctly 1`] = ` "
-
+
-
+
@@ -93,12 +93,12 @@ exports[`ColorPicker > renders with format hsl correctly 1`] = ` exports[`ColorPicker > renders with format lab correctly 1`] = ` "
-
+
-
+
@@ -108,12 +108,12 @@ exports[`ColorPicker > renders with format lab correctly 1`] = ` exports[`ColorPicker > renders with format rgb correctly 1`] = ` "
-
+
-
+
@@ -123,12 +123,12 @@ exports[`ColorPicker > renders with format rgb correctly 1`] = ` exports[`ColorPicker > renders with size lg correctly 1`] = ` "
-
+
-
+
@@ -138,12 +138,12 @@ exports[`ColorPicker > renders with size lg correctly 1`] = ` exports[`ColorPicker > renders with size md correctly 1`] = ` "
-
+
-
+
@@ -153,12 +153,12 @@ exports[`ColorPicker > renders with size md correctly 1`] = ` exports[`ColorPicker > renders with size sm correctly 1`] = ` "
-
+
-
+
@@ -168,12 +168,12 @@ exports[`ColorPicker > renders with size sm correctly 1`] = ` exports[`ColorPicker > renders with size xl correctly 1`] = ` "
-
+
-
+
@@ -183,12 +183,12 @@ exports[`ColorPicker > renders with size xl correctly 1`] = ` exports[`ColorPicker > renders with size xs correctly 1`] = ` "
-
+
-
+
@@ -198,12 +198,12 @@ exports[`ColorPicker > renders with size xs correctly 1`] = ` exports[`ColorPicker > renders with ui correctly 1`] = ` "
-
+
-
+
diff --git a/test/components/__snapshots__/ColorPicker.spec.ts.snap b/test/components/__snapshots__/ColorPicker.spec.ts.snap index 8a24a0b13c..0ca8242e24 100644 --- a/test/components/__snapshots__/ColorPicker.spec.ts.snap +++ b/test/components/__snapshots__/ColorPicker.spec.ts.snap @@ -3,12 +3,12 @@ exports[`ColorPicker > renders with as correctly 1`] = ` "
-
+
-
+
@@ -18,12 +18,12 @@ exports[`ColorPicker > renders with as correctly 1`] = ` exports[`ColorPicker > renders with class correctly 1`] = ` "
-
+
-
+
@@ -33,12 +33,12 @@ exports[`ColorPicker > renders with class correctly 1`] = ` exports[`ColorPicker > renders with disabled correctly 1`] = ` "
-
+
-
+
@@ -48,12 +48,12 @@ exports[`ColorPicker > renders with disabled correctly 1`] = ` exports[`ColorPicker > renders with format cmyk correctly 1`] = ` "
-
+
-
+
@@ -63,12 +63,12 @@ exports[`ColorPicker > renders with format cmyk correctly 1`] = ` exports[`ColorPicker > renders with format hex correctly 1`] = ` "
-
+
-
+
@@ -78,12 +78,12 @@ exports[`ColorPicker > renders with format hex correctly 1`] = ` exports[`ColorPicker > renders with format hsl correctly 1`] = ` "
-
+
-
+
@@ -93,12 +93,12 @@ exports[`ColorPicker > renders with format hsl correctly 1`] = ` exports[`ColorPicker > renders with format lab correctly 1`] = ` "
-
+
-
+
@@ -108,12 +108,12 @@ exports[`ColorPicker > renders with format lab correctly 1`] = ` exports[`ColorPicker > renders with format rgb correctly 1`] = ` "
-
+
-
+
@@ -123,12 +123,12 @@ exports[`ColorPicker > renders with format rgb correctly 1`] = ` exports[`ColorPicker > renders with size lg correctly 1`] = ` "
-
+
-
+
@@ -138,12 +138,12 @@ exports[`ColorPicker > renders with size lg correctly 1`] = ` exports[`ColorPicker > renders with size md correctly 1`] = ` "
-
+
-
+
@@ -153,12 +153,12 @@ exports[`ColorPicker > renders with size md correctly 1`] = ` exports[`ColorPicker > renders with size sm correctly 1`] = ` "
-
+
-
+
@@ -168,12 +168,12 @@ exports[`ColorPicker > renders with size sm correctly 1`] = ` exports[`ColorPicker > renders with size xl correctly 1`] = ` "
-
+
-
+
@@ -183,12 +183,12 @@ exports[`ColorPicker > renders with size xl correctly 1`] = ` exports[`ColorPicker > renders with size xs correctly 1`] = ` "
-
+
-
+
@@ -198,12 +198,12 @@ exports[`ColorPicker > renders with size xs correctly 1`] = ` exports[`ColorPicker > renders with ui correctly 1`] = ` "
-
+
-
+