Skip to content

Commit ca9b4b4

Browse files
Rogerio-Fialhosamir-ayoub
authored andcommitted
fix(lookup) corrige descrição dos registros
Corige problema da descrição dos registros quando era filtrado a partir de um codigo 0. Fixes DTHFUI-1286
1 parent 6e945ae commit ca9b4b4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

projects/ui/src/lib/components/po-field/po-lookup/po-lookup.component.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,15 @@ describe('PoLookupComponent: ', () => {
233233
expect(component['setInputValueWipoieldFormat']).not.toHaveBeenCalled();
234234
});
235235

236+
it('setViewValue: should set nativeElement value with value if not have a formatField and valueToModel is 0', () => {
237+
component.fieldFormat = undefined;
238+
component['valueToModel'] = 0;
239+
240+
component.setViewValue('valueTeste', objectSelected);
241+
242+
expect(component.inputEl.nativeElement.value).toBe('valueTeste');
243+
});
244+
236245
it('setViewValue: should set nativeElement value with `` when not have a formatField and not have a valueToModel', () => {
237246
component.fieldFormat = undefined;
238247
component['valueToModel'] = undefined;

projects/ui/src/lib/components/po-field/po-lookup/po-lookup.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class PoLookupComponent extends PoLookupBaseComponent implements OnDestro
113113
if (this.fieldFormat) {
114114
this.setInputValueWipoieldFormat(object);
115115
} else {
116-
this.inputEl.nativeElement.value = this.valueToModel ? value : '';
116+
this.inputEl.nativeElement.value = this.valueToModel || this.valueToModel === 0 ? value : '';
117117
}
118118
}
119119

0 commit comments

Comments
 (0)