react-component/color-picker

Feature request - [disabled] attribute

mmartyniuk opened this issue · 4 comments

Is there a possibility to add a new property so that in some cases picker is not opened?

I am using this component as a form element, sometimes it needs to be disabled.

+1 for this feature! We could use it as well.

I'm also +1 for this feature. I think that this feature must be implemented in the rc-trigger first, so the color-picker may receive the disabled prop and just pass to the rc-trigger.

A hack, define a component as:

const DisabledColorPicker = ({color}) => <span 
    class="rc-color-picker-trigger" 
    unselectable="unselectable" 
    style={{backgroundColor: color || 'rgb(51, 102, 204)'}}
/>

Looking at this component's code, it looks like it does actually take a disabled prop, but if you have any children passed to the component, it still sets up an onClick handler that toggles the color picker pop-up. It is a pretty easy fix - would gladly add a PR. I'm just not sure if this library is still maintained because it looks like the last activity was 2 years ago..?