Skip to content

Popover scroll behavior should work for scrollable containers too #107

@joshuarrrr

Description

@joshuarrrr

Is your feature request related to a problem? Please describe.

One of the responsibilities of the OuiPopover component is to correctly position itself relative to some other component. But positioning may need to be updated if the reference component moves (e.g. if it's in a srollable container). The repositionOnScroll property is intended to provide this functionality, but it only listens to scroll events on window currently.

Describe the solution you'd like

I'd like to update the implementation of repositionOnScroll to add scroll listeners for any parent nodes; alternatively, we may want to refactor the property so that it can actually take a particular node to bound listeners to as a value.

Describe alternatives you've considered

We could also expose the positionPopover method and allow developers to take ownership over position updates, but this seems like it would duplicate lots of functionality already built into OuiPopover (such as debouncing).

Additional context

An example limitation is described it opensearch-project/OpenSearch-Dashboards#2782

Screen.Recording.2022-11-04.at.11.58.45.AM.mov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions