mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ColorPickerInput: Allow returning empty color value (#52650)
* ColorPickerInput: Allow returning empty color value * ColorPickerInput: Do not call onChange if the value didn't change
This commit is contained in:
parent
f9d8b68543
commit
1e3135b18a
@ -29,6 +29,14 @@ export const ColorPickerInput = forwardRef<HTMLInputElement, ColorPickerInputPro
|
||||
|
||||
useThrottleFn(
|
||||
(c) => {
|
||||
if (c === value) {
|
||||
return;
|
||||
}
|
||||
// Default to an empty string if no color value is available
|
||||
if (!c) {
|
||||
onChange('');
|
||||
return;
|
||||
}
|
||||
const color = theme.visualization.getColorByName(c);
|
||||
if (returnColorAs === 'rgb') {
|
||||
onChange(colorManipulator.asRgbString(color));
|
||||
|
Loading…
Reference in New Issue
Block a user