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

Selected color can't be saved because it is not in COLOR_CHOICES #68

Closed
DavidNiceblue opened this issue Jul 9, 2021 · 6 comments
Closed
Assignees

Comments

@DavidNiceblue
Copy link

I think COLOR_CHOICES will help users quickly choose the color what he want.The colors in COLOR_CHOICES are just recommendation for users.If users want to choose other colors that not in COLOR_CHOICES,I think he can also submit.Otherwise, the COLOR_CHOICES appearing while the color picker exist will be meaningless.

@fabiocaccamo
Copy link
Owner

fabiocaccamo commented Jul 12, 2021

@DavidNiceblue thank you for reporting this, I think there should be 2 different scenarios:

  • When color choices option is defined, the picker should display only the choices and allow only a valid choice in validation.

  • When color samples option is defined (this option is not supported yet, it should be added), the picker should allow both sample selection or custom color selection.

  • choices and samples options must be mutually exclusive.

@rcatajar what do you think about this?

@rcatajar
Copy link
Contributor

This is a good idea.
Unfortunately it seems like jscolor does not have an option to disable the picker, so it's not super easy to implement.

@fabiocaccamo
Copy link
Owner

@rcatajar maybe it is possible to hide the picker spectrum via css, I will try to do it.

@fabiocaccamo
Copy link
Owner

@rcatajar I checked what was possible to do via css, but unfortunately there is just one jscolor instance in each page and it has not any attribute that could allow to select it depending on which input is active.

@fabiocaccamo fabiocaccamo changed the title selected color can't be saved because it is not in COLOR_CHOICES Selected color can't be saved because it is not in COLOR_CHOICES Oct 13, 2021
@rniem379349
Copy link
Contributor

@fabiocaccamo thanks for merging my PR, would you consider cutting a new release soon? I could then use this in a project instead of my fork. What do you think?

@fabiocaccamo
Copy link
Owner

@rniem379349 you can upgrade to 0.5.0 version. Thanks for the PR.

I would keep this issue open until we find a way to hide the spectrum when using choices.

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

4 participants