Skip to content

Commit

Permalink
Merge pull request #30536 from ishpaul777/fix/30510
Browse files Browse the repository at this point in the history
[CP Stag] Fix: crash on click of Error message CTA

(cherry picked from commit 533a373)
  • Loading branch information
luacmartins authored and OSBotify committed Oct 27, 2023
1 parent 39e3b09 commit 5a87f06
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Form/FormProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ function FormProvider({validate, formID, shouldValidateOnBlur, shouldValidateOnC

return {
...propsToParse,
ref: newRef,
ref:
typeof propsToParse.ref === 'function'
? (node) => {
propsToParse.ref(node);
newRef.current = node;
}
: newRef,
inputID,
key: propsToParse.key || inputID,
errorText: errors[inputID] || fieldErrorMessage,
Expand Down

0 comments on commit 5a87f06

Please sign in to comment.