Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/watcher-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class WatcherHelper {
}

private _isDifferentValues(oldValue: any, newValue: any, deepCheck: boolean) {
if (deepCheck && newValue instanceof (Object)) {
if (deepCheck && newValue instanceof (Object) && oldValue instanceof (Object)) {
return this._checkObjectsFields(newValue, oldValue);
}
return oldValue !== newValue;
Expand Down
32 changes: 31 additions & 1 deletion tests/src/ui/form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import DxForm from 'devextreme/ui/form';

import {
DxFormModule,
DxTagBoxModule,
DxFormComponent
} from '../../../dist';

Expand All @@ -35,7 +36,7 @@ describe('DxForm', () => {
TestBed.configureTestingModule(
{
declarations: [TestContainerComponent],
imports: [DxFormModule]
imports: [DxFormModule, DxTagBoxModule]
});
});

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

it('should work with dxTagBox', async(() => {
TestBed.overrideComponent(TestContainerComponent, {
set: {
template: `
<dx-form
[formData]="{}"
[items]="[{
dataField: 'name',
editorType: 'dxTagBox',
editorOptions: {
dataSource: [{ value: 1, text: 'item 1' }, { value: 2, text: 'item 2' }, { value: 3, text: 'item 3' }],
displayExpr: 'text',
valueExpr: 'value'
}
}]"></dx-form>
`
}
});
let fixture = TestBed.createComponent(TestContainerComponent);
fixture.detectChanges();

let formInstance = getWidget(fixture);
let tagBoxInstance = formInstance.getEditor('name');

tagBoxInstance.option('value', [2]);
fixture.detectChanges();

expect(formInstance.option('formData.name')).toEqual([2]);
}));
});