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

How to set initial color without triggering color:change callback? (solved) #261

Closed
wrybread opened this issue Oct 30, 2023 · 1 comment
Closed

Comments

@wrybread
Copy link

When I set the color when the page first loads:

colorPicker.color.set("rgb(255, 16, 65)");

It fires my color:change callback, which makes my script think someone has selected a color.

colorPicker.on('color:change', function(color) {
  send_color(color.rgb);
});

This breaks my script since I only want to send the color choice if it was manually selected.

Is there a way to set the initial color color on the picker without triggering the color:change callback?

@wrybread
Copy link
Author

Sorry, solved, changed event to input:change.

@wrybread wrybread changed the title How to set initial color without triggering color:change callback? How to set initial color without triggering color:change callback? (solved) Oct 30, 2023
@jaames jaames closed this as completed Oct 31, 2023
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

No branches or pull requests

2 participants