#850 El autocomplete hace dos peticiones en lugar de una

This commit is contained in:
Gerard 2018-12-20 10:52:08 +01:00
parent 35f408571e
commit 110fb9e3eb
2 changed files with 1 additions and 9 deletions

View File

@ -36,6 +36,7 @@ export default class Autocomplete extends Input {
this.assignDropdownProps(); this.assignDropdownProps();
this.showField = this.$.dropDown.showField; this.showField = this.$.dropDown.showField;
this.valueField = this.$.dropDown.valueField; this.valueField = this.$.dropDown.valueField;
this.refreshSelection();
} }
get model() { get model() {
@ -60,7 +61,6 @@ export default class Autocomplete extends Input {
set url(value) { set url(value) {
this.dropDownAssign({url: value}); this.dropDownAssign({url: value});
this.refreshSelection();
} }
dropDownAssign(props) { dropDownAssign(props) {

View File

@ -47,14 +47,6 @@ describe('Component vnAutocomplete', () => {
expect(controller.selection).toEqual(data); expect(controller.selection).toEqual(data);
}); });
it(`should perform a query if the item id isn't present in the data property`, inject($httpBackend => {
$httpBackend.whenGET(/testUrl.*/).respond([data]);
controller.url = 'testUrl';
$httpBackend.flush();
expect(controller.selection).toEqual(data);
}));
it(`should set selection to null when can't find an existing item in the data property`, () => { it(`should set selection to null when can't find an existing item in the data property`, () => {
expect(controller.selection).toEqual(null); expect(controller.selection).toEqual(null);
}); });