Skip to content

Commit

Permalink
Enhance EditModal to refresh the helperText field value based on vali…
Browse files Browse the repository at this point in the history
…dationHook result

For supporting refreshing the helperText field value displayed, based on the
ValidationResults (e.g., success, warning), need to set it to the
validation.helperText value instead of the constant helperText prop
value.

If validation.helperText is set to '' (initial state or for backward compatible use),
then use the initial helperText prop as was done before this fix.

Signed-off-by: Sharon Gratch <[email protected]>
  • Loading branch information
sgratch committed Nov 7, 2023
1 parent 9a79f63 commit 3485608
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const EditModal: React.FC<EditModalProps> = ({
label={label}
labelIcon={LabelIcon}
fieldId="modal-with-form-form-field"
helperText={helperText}
helperText={validation.helperText ? validation.helperText : helperText}
helperTextInvalid={validation.helperText}
validated={validation.validated}
>
Expand Down

0 comments on commit 3485608

Please sign in to comment.