If you are using the zoom CSS property to scale down UI elements the positioning of the CDK Overlay are calculated incorrectly.
Overlay positions properly as the non-zoomed styled div
Overlay positions are calculated incorrectly when the zoom: 0.9 css property is on the parent container.
https://stackblitz.com/edit/cdk-overlay-zoom
We have a Chrome only application that we use the zoom css property to scale down the UI. Using other methods of scaling does not work, so this is what we have to do.
Angular - 5.2.10
CDK - 5.2.5
@jgodi For a quick fix, you can do the following in your trigger directive: this._overlayRef.hostElement.style.zoom = "0.9"
However this brings me the question what the expected behavior actually is. Should the overlay only position correctly or should it also be zoomed accordingly when it is within the zoomed parent?
@pfeigl I face a similar problem but the solution I need is to position the overlay correctly as original. I am using mat-select and the mat-options are displayed incorrectly after zoom. As we take this example setting zoom to overlayref reduces size but position is incorrect.
Yes I had the same issue. I want to use zoom property in different devices but the mat-select dropdown is not taking right position. Should be solved. But mat-autocomplete is working fine that do not have transform property and animation. Can't we use the same?
It's angular material ver 10 now and this issue is still open!
Most helpful comment
It's angular material ver 10 now and this issue is still open!