Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Ensuring that subfields are revalidated upon change. Fixes #1020
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Nov 18, 2017
1 parent 643aeab commit eb18aa8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/reducers/form/change-action-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@ function updateFieldValue(field, action, parentModel = undefined) {
const updatedField = mapValues(value, (subValue, index) => {
// TODO: refactor
const subField = field[index]
|| createInitialState(`${`${(parentModel
? `${parentModel}.`
: '')
}${model}`}.${index}`, subValue);
|| createInitialState(`${`${(parentModel
? `${parentModel}.`
: '')
}${model}`}.${index}`, subValue);

if (Object.hasOwnProperty.call(subField, '$form')) {
return updateFieldValue(subField, {
model: index,
value: subValue,
external,
silent,
load,
}, parentModel ? `${parentModel}.${model}` : model);
}
Expand Down

0 comments on commit eb18aa8

Please sign in to comment.