Skip to content

Commit 6e93964

Browse files
committed
Fix selection on click in color area
1 parent d82b5e0 commit 6e93964

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/uui-base/lib/utils/drag.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const drag = (
2525
// TouchEvent is not available in Firefox
2626
if ('TouchEvent' in window && event instanceof TouchEvent) {
2727
pointerEvent = event.touches[0];
28-
} else if (event instanceof PointerEvent) {
28+
} else if (event instanceof MouseEvent) {
29+
// Some browsers seems to return PointerEvent instead of MouseEvent for click event.
30+
// We can use MouseEvent as PointerEvent inherits from MouseEvent.
2931
pointerEvent = event;
3032
} else {
3133
return;

0 commit comments

Comments
 (0)