popover
popover copied to clipboard
Reflecting popover position relative to trigger element
Would it be possible to add class that would reflect popover's position relative to trigger element? Whether it's above, below, to the right or left.
Thanks 🙂
The .sat-popover-container
element already has classes applied to it for animation origins
https://github.com/ncstate-sat/popover/blob/71069b6e49e141ea3a93b4f0249b2892a0238e88/src/lib/popover/popover.component.ts#L271-L280
Would it be valuable to have those on a different element or some more granularity? @fxck?
Yeah, that's for the origin, but what he meant was that as you scroll and the position changes so it still fits the screen, there's no easy way to reflect on that, the class stays sat-popover-below
despite it being above.
Do either of you have a reproduction? The class should always be matching the current position of the popover.
https://stackblitz.com/edit/sat-popover-issues-xnnclg
I do see how adding a custom container class could be helpful for this.
Tried couple of things to match my use case, wrap with overflow: scroll
and cdkScrollable
, mouseenter
instead of click
, open
instead of toggle
, different settings here and there.... but the problem in the end seems to be with OnPush
strategy on the parent component.
Check https://stackblitz.com/edit/sat-popover-issues-5nkza6?file=app%2Fapp.component.ts
@willshowell