Skip to content

Commit

Permalink
Fix required for field wrappers.
Browse files Browse the repository at this point in the history
  • Loading branch information
robgietema committed Dec 17, 2024
1 parent c9cd171 commit e872328
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const CheckboxGroupWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand Down Expand Up @@ -101,6 +102,8 @@ const CheckboxGroupWrapper = (props) => {
value: option[0],
label: option[1],
}))}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
)}
</FormFieldWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const CheckboxWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -42,6 +43,8 @@ const CheckboxWrapper = (props) => {
onChange={(value) => onChange(id, value === '' ? undefined : value)}
ref={ref}
onClick={() => onClick()}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const DatetimeWrapper = (props) => {
description,
widget,
required,
error,
intl,
} = props;

Expand Down Expand Up @@ -81,6 +82,8 @@ const DatetimeWrapper = (props) => {
onChangeTime={onDateChange}
ref={ref}
onClick={() => onClick()}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const EmailWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -47,6 +48,8 @@ const EmailWrapper = (props) => {
onClick={() => onClick()}
minLength={minLength || null}
maxLength={maxLength || null}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const FileWrapper = (props) => {
accept,
size,
required,
error,
intl,
} = props;

Expand Down Expand Up @@ -69,6 +70,8 @@ const FileWrapper = (props) => {
onChange(id, null);
}}
ref={ref}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const HiddenWrapper = (props) => {
description,
onEdit,
required,
error,
intl,
} = props;

Expand All @@ -45,6 +46,8 @@ const HiddenWrapper = (props) => {
onChange={(value) => onChange(id, value === '' ? undefined : value)}
ref={ref}
onClick={() => onClick()}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const NumberWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -44,6 +45,8 @@ const NumberWrapper = (props) => {
placeholder={placeholder}
onChange={(value) => onChange(id, value === '' ? undefined : value)}
ref={ref}
errorMessage={error ? error[0] : ''}
isInvalid={error}
onClick={() => onClick()}
/>
</FormFieldWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const RadioGroupWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -47,6 +48,8 @@ const RadioGroupWrapper = (props) => {
onChange={(value) => onChange(id, value === '' ? undefined : value)}
ref={ref}
onClick={() => onClick()}
errorMessage={error ? error[0] : ''}
isInvalid={error}
>
{options.map((option) => (
<OptionWidget value={option[0]}>{option[1]}</OptionWidget>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const SelectWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -53,6 +54,8 @@ const SelectWrapper = (props) => {
placeholder={intl.formatMessage(messages.select)}
onChange={(value) => onChange(id, value.value)}
ref={ref}
errorMessage={error ? error[0] : ''}
isInvalid={error}
onClick={() => onClick()}
options={options.map((option) => ({
value: option[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const TextWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -48,6 +49,8 @@ const TextWrapper = (props) => {
onClick={() => onClick()}
minLength={minLength || null}
maxLength={maxLength || null}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const TextareaWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -46,6 +47,8 @@ const TextareaWrapper = (props) => {
onChange={(value) => onChange(id, value === '' ? undefined : value)}
ref={ref}
onClick={() => onClick()}
errorMessage={error ? error[0] : ''}
isInvalid={error}
minLength={minLength || null}
maxLength={maxLength || null}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const TimeWrapper = (props) => {
title,
description,
required,
error,
intl,
} = props;

Expand All @@ -42,6 +43,8 @@ const TimeWrapper = (props) => {
onChange={(value) => onChange(id, value === '' ? undefined : value)}
ref={ref}
onClick={() => onClick()}
errorMessage={error ? error[0] : ''}
isInvalid={error}
/>
</FormFieldWrapper>
);
Expand Down

0 comments on commit e872328

Please sign in to comment.