-
Notifications
You must be signed in to change notification settings - Fork 234
Description
Code of conduct
- I agree to follow this project's 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
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.