Comments (6)
@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
andsamples
options must be mutually exclusive.
@rcatajar what do you think about this?
from django-colorfield.
@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
.
from django-colorfield.
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.
from django-colorfield.
@rcatajar maybe it is possible to hide the picker spectrum via css, I will try to do it.
from django-colorfield.
@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.
from django-colorfield.
@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?
from django-colorfield.
Related Issues (20)
- Add a color preview on readonly color field.
- Why do we have 2 versions of `jscolor` ? HOT 3
- Django 4.2 Error from PIL (Pillow) HOT 3
- Publish release with Django 4.2 compatibility HOT 1
- Crash when using `image_field` with RGB/RGBA formats HOT 1
- 'colorfield' not needed since django 4.0 HOT 2
- Installation missing a STATIC_ROOT step HOT 1
- Replace `JSColor` with `Coloris`.
- 500 error caused by new palette choice code in 0.4.0 HOT 4
- disable colorfield in ModelForm HOT 2
- subclasses of Widget must provide a render() method HOT 1
- name of rendered form input attribute is empty HOT 1
- Hide color-picker spectrum when using `choices`. HOT 7
- ValueError: seek of closed file
- Comma missing in MIDDLEWARE_CLASSES breaks things for Django <2
- Options not working when not using palette (choices/samples) HOT 4
- Update README to link to JSColor license HOT 2
- Show the color in the `change_list` view (currently only shows the hex value) HOT 2
- Handle possible corrupted image when using `image_field` option.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-colorfield.