From 2b9bf869fd8b2201597bf777c34d832fedd2347a Mon Sep 17 00:00:00 2001 From: Pete Ward Date: Wed, 14 Aug 2024 16:51:50 +0100 Subject: [PATCH] form-render color widget - add disabledAlpha support --- packages/form-render/src/widgets/fields/color/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/form-render/src/widgets/fields/color/index.tsx b/packages/form-render/src/widgets/fields/color/index.tsx index a12e50073..485ca61d6 100644 --- a/packages/form-render/src/widgets/fields/color/index.tsx +++ b/packages/form-render/src/widgets/fields/color/index.tsx @@ -19,7 +19,7 @@ const getAlphaFromHex = (hex = '#ffffff') => { }; const Color = (props: any) => { - const { className, schema, disabled, readOnly, value, onChange, style } = props; + const { className, schema, disabled, disabledAlpha, readOnly, value, onChange, style } = props; const onPickerChange = (ev: any) => { if (disabled || readOnly) { @@ -45,6 +45,7 @@ const Color = (props: any) => { animation='slide-up' color={(value && value.slice(0, 7)) || '#ffffff'} alpha={getAlphaFromHex(value)} + enableAlpha={!disabledAlpha} onChange={onPickerChange} disabled={true} />