#850 El autocomplete hace dos peticiones en lugar de una
This commit is contained in:
parent
35f408571e
commit
110fb9e3eb
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue