Skip to content

Commit

Permalink
Merge pull request #941 from priyadi/fix-uncaught-domexception
Browse files Browse the repository at this point in the history
Do not attempt to set value if the field is a file field
  • Loading branch information
rikschennink authored Dec 15, 2023
2 parents 8c984b5 + 5dc8a86 commit b61a9d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/app/view/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const didRemoveItem = ({ root, action }) => {
delete root.ref.fields[action.id];
};

// only runs for server files (so doesn't deal with file input)
// only runs for server files. will refuse to update the value if the field
// is a file field
const didDefineValue = ({ root, action }) => {
const field = getField(root, action.id);
if (!field) return;
Expand All @@ -72,7 +73,9 @@ const didDefineValue = ({ root, action }) => {
field.removeAttribute('value');
} else {
// set field value
field.value = action.value;
if (field.type != 'file') {
field.value = action.value;
}
}
syncFieldPositionsWithItems(root);
};
Expand Down

0 comments on commit b61a9d2

Please sign in to comment.