Skip to content

Commit ac125fd

Browse files
author
levkovskiy.dmitry
committed
resolve #336
1 parent d2262e7 commit ac125fd

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

src/core/watcher-helper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export class WatcherHelper {
4646
}
4747

4848
private _checkObjectsFields(checkingFromObject: Object, checkingToObject: Object) {
49+
if (!(checkingFromObject && checkingToObject)) {
50+
return true;
51+
}
52+
4953
for (let field in checkingFromObject) {
5054
if (checkingFromObject[field] > checkingToObject[field] || checkingFromObject[field] < checkingToObject[field]) {
5155
return true;

tests/src/ui/form.spec.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import DxForm from 'devextreme/ui/form';
1515

1616
import {
1717
DxFormModule,
18+
DxTagBoxModule,
1819
DxFormComponent
1920
} from '../../../dist';
2021

@@ -35,7 +36,7 @@ describe('DxForm', () => {
3536
TestBed.configureTestingModule(
3637
{
3738
declarations: [TestContainerComponent],
38-
imports: [DxFormModule]
39+
imports: [DxFormModule, DxTagBoxModule]
3940
});
4041
});
4142

@@ -84,4 +85,33 @@ describe('DxForm', () => {
8485
expect(instance.element().find('.dx-textbox').length).toBe(2);
8586
}));
8687

88+
it('should work with dxTagBox', async(() => {
89+
TestBed.overrideComponent(TestContainerComponent, {
90+
set: {
91+
template: `
92+
<dx-form
93+
[formData]="{}"
94+
[items]="[{
95+
dataField: 'name',
96+
editorType: 'dxTagBox',
97+
editorOptions: {
98+
dataSource: [{ value: 1, text: 'item 1' }, { value: 2, text: 'item 2' }, { value: 3, text: 'item 3' }],
99+
displayExpr: 'text',
100+
valueExpr: 'value'
101+
}
102+
}]"></dx-form>
103+
`
104+
}
105+
});
106+
let fixture = TestBed.createComponent(TestContainerComponent);
107+
fixture.detectChanges();
108+
109+
let formInstance = getWidget(fixture);
110+
let tagBoxInstance = formInstance.getEditor('name');
111+
112+
tagBoxInstance.option('value', [2]);
113+
fixture.detectChanges();
114+
115+
expect(formInstance.option('formData.name')).toEqual([2]);
116+
}));
87117
});

0 commit comments

Comments
 (0)