color-picker icon indicating copy to clipboard operation
color-picker copied to clipboard

Feature request - [disabled] attribute

Open mmartyniuk opened this issue 6 years ago • 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.

mmartyniuk avatar Jun 17 '18 18:06 mmartyniuk

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

goldpbear avatar Jul 09 '18 21:07 goldpbear

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.

luanraithz avatar Feb 09 '19 17:02 luanraithz

A hack, define a component as:

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

Santiago8888 avatar Jul 19 '19 23:07 Santiago8888

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..?

jperasmus avatar Apr 07 '20 12:04 jperasmus