diff --git a/site/source/design-system/field/DateField.tsx b/site/source/design-system/field/DateField.tsx index 3f15ad16d..2c856288c 100644 --- a/site/source/design-system/field/DateField.tsx +++ b/site/source/design-system/field/DateField.tsx @@ -86,6 +86,8 @@ export default function DateField(props: DateFieldProps) { }, [refs.reference]) const handleInputChange = (value: string) => { + console.log('DateField handleInputChange', value) + setIsOpen(false) setIsChangeOnce(true) setInputValue(value) @@ -109,6 +111,8 @@ export default function DateField(props: DateFieldProps) { const handleDaySelect = useCallback( (date?: Date) => { + console.log('DateField handleDaySelect', date) + setSelected(date) if (date) { const value = formatDate(date, format) @@ -123,12 +127,21 @@ export default function DateField(props: DateFieldProps) { [close, onChange] ) + useEffect(() => { + console.log('DateField mounted') + + return () => { + console.log('DateField unmounted') + } + }, []) + const oldDefaultSelected = useRef(defaultSelected) useEffect(() => { if ( typeof defaultSelected !== 'undefined' && oldDefaultSelected.current?.getTime() !== defaultSelected.getTime() ) { + console.log('DateField useEffect loop ?') handleDaySelect(defaultSelected) oldDefaultSelected.current = defaultSelected }