diff --git a/packages/ui-date-input/src/DateInput2/index.tsx b/packages/ui-date-input/src/DateInput2/index.tsx index 1057dbe737..2ec8e3a47a 100644 --- a/packages/ui-date-input/src/DateInput2/index.tsx +++ b/packages/ui-date-input/src/DateInput2/index.tsx @@ -184,9 +184,9 @@ const DateInput2 = ({ useEffect(() => { // don't set input messages if there is an internal error set already - if (!inputMessages.length && !invalidDateErrorMessage) { - setInputMessages(messages || []) - } + if (inputMessages.find((m) => m.text === invalidDateErrorMessage)) return + + setInputMessages(messages || []) }, [messages]) useEffect(() => { diff --git a/packages/ui-date-input/src/index.ts b/packages/ui-date-input/src/index.ts index cbfea3e729..093de6030d 100644 --- a/packages/ui-date-input/src/index.ts +++ b/packages/ui-date-input/src/index.ts @@ -25,3 +25,4 @@ export { DateInput } from './DateInput' export { DateInput2 } from './DateInput2' export type { DateInputProps } from './DateInput/props' +export type { DateInput2Props } from './DateInput2/props'