0

I'm trying to change default Overlay positioning. My code looks like this:

config.positionStrategy = this.overlay.position()
          .global()
          .left(origin.left+'px')
          .top(origin.top+'px');

and by default .cdk-overlay-pane element has this configuration:

element.style {
    width: 56px;
    height: 56px;
    position: static;
    margin-left: 412px;
    margin-top: 803px;
}

Is there's a possibility to change position and margins for top/left and looking like this?

element.style {
    width: 56px;
    height: 56px;
    **position: absolute;
    left: 412px;
    top: 803px;**
}  

I was looking for it in Overlay and PositionStrategy, but still I don't know where to find files responsible for creating .cdk-overlay-pane element.

Michał B
  • 339
  • 1
  • 3
  • 12
  • I once had a similar issue, maybe this will help: https://stackoverflow.com/a/72181051/3359635. There is a `panelClass` for overlay, which you might be able to use. – mat.hudak Aug 22 '23 at 09:23
  • Thanks for your comment. I'm using this to add custom class to this overlay, but in this cas it won't work. Position is dynamic and I cannot predefine it in css file. – Michał B Aug 22 '23 at 09:58

0 Answers0