Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: calling render() before first open throws #780

Closed
web-padawan opened this issue Mar 11, 2019 · 5 comments
Closed

Regression: calling render() before first open throws #780

web-padawan opened this issue Mar 11, 2019 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@web-padawan
Copy link
Member

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:

this.$.overlay._selector.querySelectorAll('vaadin-combo-box-item').forEach(item => item._render());

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()
@web-padawan web-padawan added bug Something isn't working good first issue Good for newcomers needs triage Has to be triaged by the team labels Mar 11, 2019
@web-padawan
Copy link
Member Author

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.

@Haprog Haprog added in progress and removed needs triage Has to be triaged by the team labels Mar 11, 2019
@Haprog Haprog self-assigned this Mar 11, 2019
@web-padawan
Copy link
Member Author

web-padawan commented Mar 11, 2019

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.

@tomivirkki
Copy link
Member

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.

@Haprog
Copy link
Contributor

Haprog commented Mar 13, 2019

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

@Haprog
Copy link
Contributor

Haprog commented Mar 18, 2019

This fix is now included in v4.2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants