Vaadin-combo-box: Regression: calling render() before first open throws

Created on 11 Mar 2019  ·  5Comments  ·  Source: vaadin/vaadin-combo-box

Description

Calling combobox.render() throws in case combo-box has not yet been open:

Cannot read property 'querySelectorAll' of undefined

This is the line where is happens:
https://github.com/vaadin/vaadin-combo-box/blob/41f870912bdd872e3376b090e863641928568a24/src/vaadin-combo-box-mixin.html#L276

Expected outcome

Calling combobox.render() doesn't throw

Actual outcome

Error is thrown

Steps to reproduce

  1. Put a vaadin-combo-box element in the page.
  2. Assign the renderer, don't open combo-box
  3. Run combobox.render()
bug good first issue

Most helpful comment

Actual items wouldn't still be rendered before the dropdown is opened so this wouldn't invoke any renderers. From this point of view would make sense to not do anything unless _selector is there.

All 5 comments

Note: this was reported for the dom-if version but should be still valid after disable-upgrade change as _selector isn't defined either until combo-box is opened for the first time.

Discussed in person that render() could actually call _initDropdown, if called before first opening of the combobox, so as it would trigger actual rendering as users might expect it to do.

Actual items wouldn't still be rendered before the dropdown is opened so this wouldn't invoke any renderers. From this point of view would make sense to not do anything unless _selector is there.

After #782 is merged and build is green, I will rebase this fix on latest master to get this one to pass also.

This fix is now included in v4.2.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heruan picture heruan  ·  14Comments

mas4ivv picture mas4ivv  ·  16Comments

anasmi picture anasmi  ·  18Comments

silentHoo picture silentHoo  ·  3Comments

steffen-harbich-cognitum picture steffen-harbich-cognitum  ·  8Comments