From 31e99240b84b6ade9ae4a14596d5bfa95c692dcc Mon Sep 17 00:00:00 2001 From: Eric Olkowski Date: Thu, 2 Nov 2023 14:32:43 -0400 Subject: [PATCH] fix(DatePicker): updated logic for parsing and focus management --- packages/react-core/src/components/DatePicker/DatePicker.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-core/src/components/DatePicker/DatePicker.tsx b/packages/react-core/src/components/DatePicker/DatePicker.tsx index 8aebe13f21f..9626eaaa171 100644 --- a/packages/react-core/src/components/DatePicker/DatePicker.tsx +++ b/packages/react-core/src/components/DatePicker/DatePicker.tsx @@ -98,7 +98,7 @@ const DatePickerBase = ( className, locale = undefined, dateFormat = yyyyMMddFormat, - dateParse = (val: string) => val.split('-').length === 3 && new Date(`${val}T00:00:00`), + dateParse = (val: string) => (val.split('-').length === 3 ? new Date(`${val}T00:00:00`) : new Date(undefined)), isDisabled = false, placeholder = 'YYYY-MM-DD', value: valueProp = '', @@ -230,7 +230,7 @@ const DatePickerBase = ( return (