Skip to content

Commit

Permalink
FIO-9010 fixed disappearance of components inside Columns after editing
Browse files Browse the repository at this point in the history
  • Loading branch information
HannaKurban authored and lane-formio committed Sep 17, 2024
1 parent 77d8973 commit 0c98a92
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/_classes/multivalue/Multivalue.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export default class Multivalue extends Field {
if (this.component.storeas === 'string') {
return super.normalizeValue(value.join(this.delimiter || ''), flags);
}
if (this.component.type === 'hidden' && value.length > 1) {
return super.normalizeValue(value, flags);
}
return super.normalizeValue(value[0] || emptyValue, flags);
} else {
return super.normalizeValue(value, flags);
Expand Down
12 changes: 12 additions & 0 deletions src/components/hidden/Hidden.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,16 @@ describe('Hidden Component', () => {
assert(component.checkValidity(), 'Item should be valid after setting value');
});
});

it('Should set correct array data for Hidden component', () => {
return Harness.testCreate(HiddenComponent, comp1).then((component) => {
const value = [
[ 1, 2, 3],
['a','b','c']
]
component.setValue(value);
assert(Array.isArray(component.dataValue), 'Value should be an Array');
assert.deepEqual(component.dataValue, value, 'Value should be be equal to the set value');
});
});
});

0 comments on commit 0c98a92

Please sign in to comment.