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.
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