Skip to content

Commit 0c48345

Browse files
committed
Fix Angular issues
1 parent ed67367 commit 0c48345

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/angular/src/abstract-control.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { Subscription } from 'rxjs';
4343
import { JsonFormsBaseRenderer } from './base.renderer';
4444
import { JsonFormsAngularService } from './jsonforms.service';
4545
import merge from 'lodash/merge';
46+
import { isEqual } from 'lodash';
4647
@Component({
4748
template: ''
4849
})
@@ -126,7 +127,9 @@ export abstract class JsonFormsAbstractControl<
126127
this.scopedSchema !== undefined ? this.scopedSchema.description : '';
127128
this.id = props.id;
128129
this.form.setValue(data);
129-
this.propsPath = path;
130+
if (!isEqual(this.propsPath, path)) {
131+
this.propsPath = path;
132+
}
130133
this.mapAdditionalProps(props);
131134
}
132135
});

packages/angular/src/jsonforms.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const areEqual = (prevProps: StatePropsOfJsonFormsRenderer, nextProps: StateProp
5757
&& get(prevProps, 'uischemas.length') === get(nextProps, 'uischemas.length')
5858
&& get(prevProps, 'schema') === get(nextProps, 'schema')
5959
&& isEqual(get(prevProps, 'uischema'), get(nextProps, 'uischema'))
60-
&& get(prevProps, 'path') === get(nextProps, 'path');
60+
&& isEqual(get(prevProps, 'path'), get(nextProps, 'path'));
6161
};
6262

6363
@Directive({
@@ -78,7 +78,9 @@ export class JsonFormsOutlet extends JsonFormsBaseRenderer<UISchemaElement>
7878

7979
@Input()
8080
set renderProps(renderProps: OwnPropsOfRenderer) {
81-
this.path = renderProps.path;
81+
if (!isEqual(this.path, renderProps.path)) {
82+
this.path = renderProps.path;
83+
}
8284
this.schema = renderProps.schema;
8385
this.uischema = renderProps.uischema;
8486
this.update(this.jsonformsService.getState());

0 commit comments

Comments
 (0)