[Feat]: Support custom boundaries element in overlay-trigger #2568
Labels
Component: Overlay
Discovery
enhancement
New feature or request
Post overlay API
Review after Overlay V2 Ships
Code of conduct
Impacted component(s)
overlay-trigger
Description of the requested feature
I would to set both the position and width of my popover relative to an element besides the trigger element. In other words, I want to select a specific element from the DOM to use as my "boundaries element".
Here's my example. In this scenario, I want the
sp-popover
to be contained within the pink box. I also want the width of the popover to match the box. I want the pink box to define the boundaries of the popover.https://studio.webcomponents.dev/edit/GnpL4UwD0h9BAbqV9DOf/src/index.ts?p=stories
Mockups or screenshots
What I get:

What I want:

Implementation notes or ideas
@pinkhominid mentioned to me that Popper has a
preventOverflow
plugin that may address this case.https://popper.js.org/docs/v2/modifiers/prevent-overflow/
Also, in React Spectrum we had a
boundariesElement
prop that provided this behavior.The text was updated successfully, but these errors were encountered: