diff --git a/src/common/ColorInput/ColorInput.js b/src/common/ColorInput/ColorInput.js index 030c6481a..eefcc2c18 100644 --- a/src/common/ColorInput/ColorInput.js +++ b/src/common/ColorInput/ColorInput.js @@ -17,10 +17,14 @@ const ColorInput = ({ className, value, onChange, ...props }) => { const [modalOpen, openModal, closeModal] = useBinaryState(false); const [tempValue, setTempValue] = React.useState(value); const pickerLabelOnClick = React.useCallback((event) => { + if (typeof props.onClick === 'function') { + props.onClick(event); + } + if (!event.nativeEvent.openModalPrevented) { openModal(); } - }, []); + }, [props.onClick]); const modalContainerOnClick = React.useCallback((event) => { event.nativeEvent.openModalPrevented = true; }, []); @@ -52,7 +56,7 @@ const ColorInput = ({ className, value, onChange, ...props }) => { setTempValue(value); }, [value, modalOpen]); return ( -