Skip to content

Commit

Permalink
editor: fix 'oneOf' behaviour
Browse files Browse the repository at this point in the history
* Fixes the behaviour of the selected values for 'oneOf' type of
data: for example, when selecting 'organisation' as author, the value of 'type' needed to be selected manually. Now the correct value of type is selected automatically. A similar behaviour is noted for 'mode of issuance' maintype and subtype.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
Alicia Zangger and jma committed Jul 20, 2020
1 parent 3d0097d commit 9fbb195
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,12 @@ export class EditorComponent implements OnInit, OnChanges, OnDestroy {
if (
!['object', 'multischema', 'array'].some(f => f === field.type)
) {
// TODO following line seems to raise an error with v5.9.0 of ngx-formly
model = field.model[field.key];
}
model = removeEmptyValues(model);
const modelEmpty = isEmpty(model);
if (!modelEmpty && (field.hide !== false)) {
if (!modelEmpty && (field.hide === true)) {
setTimeout(() => {
field.hide = false;
this._editorService.removeHiddenField(field);
Expand Down

0 comments on commit 9fbb195

Please sign in to comment.