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: do not throw error when opened is set before adding to DOM #7335

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

web-padawan
Copy link
Member

Description

Fixes vaadin/flow-components#6148

See also #4610 for a similar vaadin-tooltip fix.

When opened is set to the select in the template as an attribute, in the Polymer version overlay opens before the ready() callback is called. The opened is then reset to false as _overlayElement is empty, but due to the animation the overlay doesn't close immediately and is still under <body> by the time querySelector() is called, so the error is thrown.

Lit version doesn't have this issue since by the time ready() is called on the vaadin-select, its overlay is not yet moved to the <body>. This is apparently because in Polymer, the order of ready() callbacks invocations is from child to parent (overlay -> select), and in Lit it's from parent to child (select -> overlay).

Type of change

  • Bugfix

Copy link

sonarcloud bot commented Apr 15, 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

@web-padawan web-padawan changed the title fix: do not throw error when opened is set as an attribute fix: do not throw error when opened is set before adding to DOM Apr 15, 2024
@web-padawan web-padawan merged commit a5ac705 into main Apr 15, 2024
9 checks passed
@web-padawan web-padawan deleted the fix/select-pre-opened branch April 15, 2024 10:17
web-padawan added a commit that referenced this pull request Apr 15, 2024
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.alpha24 and is also targeting the upcoming stable 24.4.0 version.

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.

Select field doesn't work after removing with keyboard shortcut
3 participants