Skip to content

Commit

Permalink
Merge 3f8beb9 into f36cd6c
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki committed Oct 10, 2018
2 parents f36cd6c + 3f8beb9 commit 2803bad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vaadin-combo-box-data-provider-mixin.html
Expand Up @@ -164,6 +164,7 @@
if (!this.dataProvider) {
return;
}
this._pendingRequests = {};
const filteredItems = [];
filteredItems.length = this.size || 0;
this.filteredItems = new Array(...filteredItems).map(item => {
Expand Down
12 changes: 12 additions & 0 deletions test/lazy-loading.html
Expand Up @@ -614,6 +614,18 @@
const params = spyDataProvider.firstCall.args[0];
expect(params.page).to.equal(0);
});

it('should clear old pending requests', () => {
let slowCallback;
comboBox.dataProvider = (params, callback) => {
if (!slowCallback) {
slowCallback = callback;
}
};
comboBox.clearCache();
slowCallback([{}]);
expect(comboBox.filteredItems).to.be.empty;
});
});

describe('after closed', () => {
Expand Down

0 comments on commit 2803bad

Please sign in to comment.