vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
470 stars 83 forks source link

fix: do not close popover when it is just moved in DOM #8208

Closed sissbruecker closed 6 hours ago

sissbruecker commented 8 hours ago

Currently a popover is immediately closed when it is disconnected from the DOM. That can be an issue in a Flow dialog when the popover is opened right away after adding it to the dialog. Here the element is first added as a child of the dialog, then opened, and afterwards moved to the dialog overlay by the renderer function. The last step causes the popover to close again.

This fixes the issue by delaying closing and checking if the element has been added to the DOM again. This is similar to what we are doing in other components such as dialog or notification.

Fixes https://github.com/vaadin/flow-components/issues/6840

sonarcloud[bot] commented 8 hours ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud