-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: onChangeComplete event #73
feat: onChangeComplete event #73
Conversation
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.
Looks good, but there are a few things that need to be changed before merging the branches.
Thanks for your contribution!
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.
Once you make the last change, I'll test the code and merge the branches. Thanks again for your contribution!
thank you @Wondermarin!! |
Released in v7.2.0! |
Hi! This is a very good library and it is a breeze to integrate it.
I've wanted to enhance it by adding a new optional event called
onChangeComplete
that its goal to be fired right after the user stops interacting with any element, which is useful for the ones that needs to perform a side-effect action when that happens.Use case example: You want to save the user's chosen color either remotely thru an API or locally in the storage. By hooking up this action on
onChange
, you will have a lot of actions happening as the user might be exploring the color picker up until the point it stops the interaction.Description of Change
A new prop is added to Interactive component and therefore propagated into Alpha, Saturation and Hue ones. I've also added the change into Fields by leveraging the onBlur input event.
In Interactive component I've chosen to modify the original
move
event by adding a boolean at the end by I'm not completely sure that is the best option to achieve the goal. Happy to apply any modifications you may see necessary.Finally, added the README.md changes: one new example using the new event and add a new entry to the prop table.