-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Bug Fix: added a fix for discarding multiple color picker entries on drag #5335
Bug Fix: added a fix for discarding multiple color picker entries on drag #5335
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
PR is ready for review. |
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.
Thank you for the fix!
@@ -186,14 +203,21 @@ function MoveWrapper({className, style, onChange, children}: MoveWrapperProps) { | |||
move(e); | |||
|
|||
const onMouseMove = (_e: MouseEvent): void => { | |||
setDragged(true); | |||
updateSkipHistoryFlag(true); |
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.
Do we need a useState
here or can we do with useRef
? It might be easier to debug later without the side effects of having this variable is the useEffect dependency. I believe even a module variable would suffice for this case since there can only be one event in total in the entire page
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.
@zurfyx Thanks for the review.
Agreed, useState
was not necessary, have made he skipFlag to be module variable and dragged
to be useRef
PR is ready for review |
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.
LGTM
fix: #3890
Before:
290535690-733a836e-78ea-421f-8dbd-5b81485d7d90.mov
After:
Screen.Recording.2023-12-14.at.6.57.32.PM.mp4