Skip to content

Fix selection on click in color area #1075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: v1/contrib
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/uui-base/lib/utils/drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export const drag = (
// TouchEvent is not available in Firefox
if ('TouchEvent' in window && event instanceof TouchEvent) {
pointerEvent = event.touches[0];
} else if (event instanceof PointerEvent) {
} else if (event instanceof MouseEvent) {
// Some browsers seem to return PointerEvent instead of MouseEvent for click event.
// We can use MouseEvent as PointerEvent inherits from MouseEvent.
// Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1675847
// Safari: https://bugs.webkit.org/show_bug.cgi?id=218665
pointerEvent = event;
} else {
return;
Expand Down
Loading