Skip to content

Commit

Permalink
Merge pull request #7112 from marmelab/fix-pristine-arrayinput
Browse files Browse the repository at this point in the history
Fix `ArrayInput` could make the form dirty on initialization
  • Loading branch information
djhi authored Jan 20, 2022
2 parents da2996e + 7234bd6 commit b4dee2f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { cloneElement, Children, ReactElement } from 'react';
import PropTypes from 'prop-types';
import isEqual from 'lodash/isEqual';
import {
isRequired,
FieldTitle,
Expand Down Expand Up @@ -83,6 +84,8 @@ export const ArrayInput = (props: ArrayInputProps) => {
initialValue: defaultValue,
validate: sanitizedValidate,
...rest,
isEqual: (allPreviousValues, allNewValues) =>
isEqual(allPreviousValues, allNewValues),
});

if (loading) {
Expand Down

0 comments on commit b4dee2f

Please sign in to comment.