diff --git a/packages/gamut/package.json b/packages/gamut/package.json index 7d065d8fb1..10b674f268 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -21,7 +21,7 @@ "polished": "^4.1.2", "react-aria-tabpanel": "^4.4.0", "react-focus-on": "^3.5.1", - "react-hook-form": "^7.21.2", + "react-hook-form": "^7.53.1", "react-player": "^2.16.0", "react-select": "^5.2.2", "react-truncate-markup": "^5.1.2", diff --git a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx index 29a3ace294..5bb53fa8fa 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx @@ -14,7 +14,7 @@ import { Anchor } from '../Anchor'; import { HiddenText } from '../HiddenText'; import { Markdown } from '../Markdown'; import { ConnectedField, FieldProps, SubmitContextProps } from './types'; -import { useField } from './utils'; +import { getErrorMessage, useField } from './utils'; const ErrorAnchor = styled(Anchor)( css({ @@ -88,6 +88,8 @@ export function ConnectedFormGroup({ ); + const textError = customError || getErrorMessage(error); + return ( {hideLabel ? {renderedLabel} : renderedLabel} @@ -112,7 +114,7 @@ export function ConnectedFormGroup({ }} skipDefaultOverrides={{ a: true }} inline - text={error || customError} + text={textError} spacing="none" /> diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx index 6be1764aba..333e1a48bb 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx @@ -17,7 +17,7 @@ export const ConnectedInput: React.FC = ({ return ( = ({ disabled, }); - return ; + return ( + + ); }; diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx index 73cabeac74..8aa9078c43 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx @@ -17,7 +17,7 @@ export const ConnectedSelect: React.FC = ({ return (