Skip to content

Commit f22a3aa

Browse files
authored
Merge pull request #344 from DevExpress/Fix_dxTagBox_in_dxScheduler
resolve #336
2 parents d7f5d41 + 8e697ab commit f22a3aa

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

src/core/watcher-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class WatcherHelper {
3939
}
4040

4141
private _isDifferentValues(oldValue: any, newValue: any, deepCheck: boolean) {
42-
if (deepCheck && newValue instanceof (Object)) {
42+
if (deepCheck && newValue instanceof (Object) && oldValue instanceof (Object)) {
4343
return this._checkObjectsFields(newValue, oldValue);
4444
}
4545
return oldValue !== newValue;

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)