Skip to content
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

Merged
merged 7 commits into from
Jun 27, 2024

Conversation

luizcieslak
Copy link
Contributor

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.

Copy link
Owner

@Wondermarin Wondermarin left a 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!

src/components/interactive/interactive.component.tsx Outdated Show resolved Hide resolved
src/components/interactive/interactive.component.tsx Outdated Show resolved Hide resolved
src/components/hue/hue.component.tsx Outdated Show resolved Hide resolved
src/components/color-picker/color-picker.component.tsx Outdated Show resolved Hide resolved
Copy link
Owner

@Wondermarin Wondermarin left a 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!

README.md Outdated Show resolved Hide resolved
@luizcieslak
Copy link
Contributor Author

thank you @Wondermarin!!

@Wondermarin Wondermarin merged commit 2aa616e into Wondermarin:main Jun 27, 2024
@github-actions github-actions bot mentioned this pull request Jun 27, 2024
@Wondermarin
Copy link
Owner

Released in v7.2.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants