Skip to content

Commit 3ff5554

Browse files
author
React-Admin CI
committed
Don't trigger onChange unnecessarily
1 parent fbc8541 commit 3ff5554

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ra-ui-materialui/src/input/DateInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export const DateInput = ({
133133
(localInputRef.current.valueAsDate != null &&
134134
!isNaN(new Date(localInputRef.current.valueAsDate).getTime()));
135135

136-
if (isNewValueValid) {
136+
if (isNewValueValid && field.value !== newValue) {
137137
field.onChange(newValue ?? '');
138138
}
139139

0 commit comments

Comments
 (0)