Angular material dialog component hides all my website components

前端 未结 8 2578
野趣味
野趣味 2021-02-14 08:05

I\'m using angular 5 and angular material (latest version) and I\'m trying to open a dialog from a page. When I click the button that triggers the opening, the entire website is

8条回答
  •  感情败类
    2021-02-14 08:52

    This is due to cdk-global-scrollblock that is injected into the HTML body which will affect your components that have position absolute.

    You can override it in the Angular Material theme CSS with:

    .cdk-global-scrollblock {
        position: static;
        overflow: hidden !important;
    }
    

    or with deprecated Shadow-Piercing:

    /deep/ .cdk-global-scrollblock {
        position: static;
        overflow: hidden !important;
    }
    

提交回复
热议问题