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

.setColor() doesn't work if called immediately after pickr creation #344

Open
Bug-Reaper opened this issue Feb 22, 2025 · 0 comments
Open
Labels
unconfirmed The problem isn't really clear

Comments

@Bug-Reaper
Copy link

Bug-Reaper commented Feb 22, 2025

What is the current behavior?

Documenting that setColor called right after Pickr declarations silently NO-OPs and fails to change color

Please provide the steps to reproduce and create a JSFiddle.

        shellColor = Pickr.create({...pickerOpts, el: shellColorDiv});
        shellColor.setColor(`#FF0000`);
       // Color not set `#FF0000` but if we wrap in setTimeout works normally

🔗 Fiddle With Bug Active

What is the expected behavior?

setColor should work or the behavior should be documented

Your environment:

Version (see Pickr.version): Latest
Used bundle (es5 or normal one): normal
Used theme (default is classic):  classic
Browser-version:  FireFox
Operating-system:  MacOS

Thoughts

I'd guess that setColor is clobbered by some race-condition but unclear why. If a PR would be accepted for a fix, happy to take a stab at it.

@Bug-Reaper Bug-Reaper added the unconfirmed The problem isn't really clear label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed The problem isn't really clear
Projects
None yet
Development

No branches or pull requests

1 participant