Skip to content

Commit

Permalink
Fixed ListField (closes #125).
Browse files Browse the repository at this point in the history
  • Loading branch information
radekmie committed Nov 2, 2016
1 parent 9ccf292 commit 2f248ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/uniforms/src/components/fields/BaseField.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export default class BaseField extends Component {
return true;
}

// TODO: This might be optimized.
if (nextName.indexOf('.') !== -1) {
const prevParentValue = get(prevContext.model, prevName.replace(/(.+)\..+$/, '$1'));
const nextParentValue = get(nextContext.model, nextName.replace(/(.+)\..+$/, '$1'));

// eslint-disable-next-line max-len
if (Array.isArray(nextParentValue) && (!prevParentValue || prevParentValue.length !== nextParentValue.length)) {
if (Array.isArray(nextParentValue) && !isEqual(prevParentValue, nextParentValue)) {
return true;
}
}
Expand Down

0 comments on commit 2f248ec

Please sign in to comment.