Skip to content

Commit f777a6b

Browse files
committed
fix(input-date): allow external value change to clear date value
1 parent 64a25ca commit f777a6b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/ui-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdacurry/component-library",
3-
"version": "6.3.11",
3+
"version": "6.3.12",
44
"description": "A React component library created by Lambda Curry.",
55
"author": "Lambda Curry",
66
"license": "ISC",

packages/ui-components/src/lib/inputs/InputDate/InputDate.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export const InputDate: FC<InputDateProps> = ({
3838
const [inputValue, setInputValue] = React.useState<DateTime | null>(fieldValue);
3939

4040
useEffect(() => {
41-
if (fieldDateTime.isValid || fieldValue === '' || fieldValue === null) setInputValue(fieldValue);
41+
if (fieldDateTime.isValid || fieldValue === '' || fieldValue === null) {
42+
setInputValue(fieldValue ? fieldValue : null);
43+
}
4244
}, [fieldValue]);
4345

4446
return (

0 commit comments

Comments
 (0)