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

fix: only clear overlay root when assigning a renderer if needed #7313

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Apr 10, 2024

Description

This PR is needed for vaadin-combo-box Lit version to prevent issue with re-creating vaadin-combo-box-scroller.

Currently with the Lit version, setting overlay.renderer triggers observer in OverlayMixin which clears innerHTML without checking for the old renderer. Then on overlay open, the scroller is re-attached by calling appendChild().

This isn't the case in Polymer version where observers run differently and clearing innerHTML is called before the first renderer invocation by requestContentUpdate(). Note: changing all the properties to use sync: true doesn't help.

While vaadin-combo-box Lit tests pass on the main branch, they start to fail in Safari after postponing the virtualizer initialization until open in #7277 - and apparently the fact that scroller is reattached is related to that.

I figured out that we don't need to clear innerHTML anyway if there is no old renderer yet.

Type of change

  • Bugfix

@web-padawan web-padawan force-pushed the fix/overlay-prevent-clear-renderer branch from 6a7e76a to 8691674 Compare April 10, 2024 08:22
Copy link

sonarcloud bot commented Apr 10, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants