Skip to content

Commit

Permalink
fix(core): include field without key on hide changed programmatically (
Browse files Browse the repository at this point in the history
  • Loading branch information
aitboudad committed Nov 6, 2019
1 parent 2d73fb9 commit 39a9051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('FieldExpressionExtension', () => {
it('should toggle field control when hide changed programmatically', () => {
const fields: FormlyFieldConfig[] = [
{ hide: false, key: 'foo'},
{ hide: true, key: 'bar'},
{ hide: true, fieldGroup: [{key: 'bar'}]},
];
builder.buildForm(form, fields, {}, options);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class FieldExpressionExtension implements FormlyExtension {
field.hideExpression,
parent && parent.hideExpression ? () => parent.hide : undefined,
);
} else if (field.key) {
} else {
wrapProperty(field, 'hide', ({ currentValue, firstChange }) => {
if (!firstChange || (firstChange && currentValue === true)) {
field.options._hiddenFieldsForCheck.push(field);
Expand Down

0 comments on commit 39a9051

Please sign in to comment.