-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Adding a color change "end" event #187
Comments
This would be very useful for me too |
Good idea +1 |
+1 |
1 similar comment
+1 |
It will be useful for undo/redo functionality. I have already implemented your color picker and it works really well, but without this functionality I have to rolling back the changes. You can just add extra parameter to onChange event. For example
Thank you in advance! |
If someone looking for temporary solution. You can add mouse down\move\up(don't forget about touch events as well) events(or more easier - use react-use-gesture library) to the extra div which is wrapper for ColorPicker |
A common pattern in React is to have global state management. Even with debouncing, frequent updates on any moderately large global state is expensive. Would it be possible to add a
changeEnd
event that returns a final value based on perhaps on internalmouseup
event of the different color pickers?This would allow updating state once on user input completion.
An example use case would be - considering the color picker for the graphic design tool canva.com - where color updates are reflected in real time on elements the user is editing. This part of the problem can perhaps be handled imperatively. However, we would still need to update the state with the final value to sync it with imperatively updated values. This is where an
changeEnd
event would be useful.Happy to hear feedback and if you'd be open to me working on a PR.
Thanks.
The text was updated successfully, but these errors were encountered: