Skip to content

Commit

Permalink
Fix calling render() before first open to not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Haprog committed Mar 12, 2019
1 parent 41f8709 commit 64d269f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vaadin-combo-box-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@
* Manually invoke existing renderer.
*/
render() {
this.$.overlay._selector.querySelectorAll('vaadin-combo-box-item').forEach(item => item._render());
if (this.$.overlay._selector) {
this.$.overlay._selector.querySelectorAll('vaadin-combo-box-item').forEach(item => item._render());
}
}

_setTemplateFromNodes(nodes) {
Expand Down
12 changes: 12 additions & 0 deletions test/vaadin-combo-box.html
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,18 @@
});
});
});

describe('Methods', () => {
let comboBox;

beforeEach(() => {
comboBox = fixture('combobox');
});

it('should not throw if render() called before opening', () => {
expect(() => comboBox.render()).not.to.throw(Error);
});
});
</script>

</body>
Expand Down

0 comments on commit 64d269f

Please sign in to comment.