[Popover] [Potential Feature Request] How to align the start of the popover with the center of the trigger? #1195
Labels
component: popover
The React component.
enhancement
This is not a bug, nor a new feature
support: question
Community support but can be turned into an improvement
First of all, amazing work on this library. The alpha version looks super solid already.
I've come across a potential limitation when using
Popover
. My design requires me to align the left / start of the popover with the center of the trigger (minus an offset, because actually the goal is to align the center of the first column of the popover, which has a fixed width... but that's irrelevant). With thealign
prop, it only seems possible to align thestart
of the popover with the start of the trigger, thecenter
of the popover with the center of the trigger, or theend
of the popover with the end of the trigger. Is there a solution I'm not seeing, given that the trigger has an unknown/dynamic width? If not, I have 2 potential (but very rough) ideas of how it could be handled (assuming you agree that it's a worthy use case!)triggerAlign
or something, which would default to the same value asalign
, but in my case I would set it tocenter
.alignOffset
prop could accept a function that would receive the dimensions of the trigger and of the popup, and could do some math based on those to return an offset value?Thanks so much again, I'm excited to see how this library evolves.
The text was updated successfully, but these errors were encountered: