Skip to content

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

@Bug-Reaper

Description

@Bug-Reaper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmedThe problem isn't really clear

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions