Skip to content

[overlay] Update attached instances logic to not rely on body children #9700

Closed

Description

@web-padawan

Motivation

The following logic in the OverlayStackMixin needs to be updated for switching to native popover:

const getAttachedInstances = () =>
Array.from(document.body.children)
.filter((el) => el instanceof HTMLElement && el._hasOverlayStackMixin && !el.hasAttribute('closing'))
.sort((a, b) => a.__zIndex - b.__zIndex || 0);

Proposed solution

Store overlays in an array / set, instead of checking document.body.children.

Prototype: https://github.com/vaadin/web-components/compare/refactor/overlay-instances-stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions