Skip to content

Commit

Permalink
fix(ui-date-input): fix DateInput2 to update messages properly
Browse files Browse the repository at this point in the history
  • Loading branch information
balzss committed Oct 31, 2024
1 parent cc742d1 commit 553a235
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ui-date-input/src/DateInput2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/ui-date-input/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
export { DateInput } from './DateInput'
export { DateInput2 } from './DateInput2'
export type { DateInputProps } from './DateInput/props'
export type { DateInput2Props } from './DateInput2/props'

0 comments on commit 553a235

Please sign in to comment.