Skip to content

Commit

Permalink
Merge pull request #1545 from peteward/pw-color-picker-disabledAlpha
Browse files Browse the repository at this point in the history
form-render: add color picker disabled alpha support
  • Loading branch information
lhbxs authored Aug 15, 2024
2 parents c6756e1 + 2b9bf86 commit dc25792
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/form-render/src/widgets/fields/color/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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}
/>
Expand Down

0 comments on commit dc25792

Please sign in to comment.