-
Notifications
You must be signed in to change notification settings - Fork 53
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
base: v1/contrib
Are you sure you want to change the base?
Conversation
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for the team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a regression in the color area selection by addressing the event type check for click events in Chrome.
- Changed event check from PointerEvent to MouseEvent to account for browsers that return PointerEvent as MouseEvent.
- Added a clarifying comment about browser behavior regarding event types.
Co-authored-by: Copilot <[email protected]>
|
Description
Fixes regression made in PR #1001 and metioned here: #1001 (comment)
Noticed in Chrome Version 135.0.7049.96 / Win 10 Pro.
In Chrome the click event returns
MouseEvent
, so it went toelse
statement and stopped executing theonMove()
event.It may be a bug that Firefox return
PointerEvent
as click is aMouseEvent
:https://stackoverflow.com/a/76900433
I can reproduce to issue in Firefox as well, so it may only be an issue click returning
PointerEvent
in older versions of Firefox and Safari as these has been resolved:https://bugzilla.mozilla.org/show_bug.cgi?id=1675847
https://bugs.webkit.org/show_bug.cgi?id=218665
However it is safe casting to
MouseEvent
asPointerEvent
inherits from this:https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event
Types of changes
Motivation and context
How to test?
Screenshots (if appropriate)
Checklist