popover icon indicating copy to clipboard operation
popover copied to clipboard

Reflecting popover position relative to trigger element

Open Trollyal opened this issue 6 years ago • 4 comments

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 🙂

Trollyal avatar Jul 12 '18 12:07 Trollyal

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?

willshowell avatar Jul 12 '18 14:07 willshowell

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.

fxck avatar Jul 12 '18 15:07 fxck

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.

willshowell avatar Jul 12 '18 15:07 willshowell

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

fxck avatar Jul 13 '18 08:07 fxck