Skip to content

Popover doesn't maintain position relative to element when inside scrolling container #5

@cwqt

Description

@cwqt

Triggering a popover from an element inside a scrolling container causes the popover to be static when scrolling inside parent - this is because the overlay is position relative to the window & not to the scrolling container.

Though it might be a good idea to provide a class string/id instead of an HtmlElement because parent elements may be many levels up in the component hierarchy and awkward to pass through to the popover.load

e.g.

<app-wrapper>
    <some-component class="scrolling-container">
        <and-another>
            <popover-stuff></popover-stuff>
        </and-another>
    </some-component>
</app-wrapper>
this.popover.load({
   injectOverlayInside: "scrolling-container"
})

Passing a class/id avoids drilling the element through multiple components.
Tried to fix this myself but the underlying CDK is closed-source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions