react-color-palette
react-color-palette copied to clipboard
feat: add disabled flag to color picker component
Description of Change
Hi, I loved the package, simple and beautiful.
As I was using it to build my own ready-to-use UI components, I missed the disabled flag as prop.
It is useful for when you don't want the user to update the existing color. I can think in those examples:
a) when the current user does not have the permission to edit; b) when you can not change the color once it was set;
Of course, another solution for those cases would be to only display the color in a badge for example, but in the end I wanted to contribute somehow. Plus, you can check it is common to have this disabled flag (e.g.: https://primereact.org/colorpicker/)
That's it guys. Quick overview and PR, if you found this a good idea please test it before merge. If don't think it is a good idea, no problem at all. ;)