Ng-zorro-antd: [bug] modal padding-right

Created on 25 Jun 2018  ·  7Comments  ·  Source: NG-ZORRO/ng-zorro-antd

Most helpful comment

padding-right 不能每次都加, 我觉得最合理的是应该先判断页面是否有滚动条,如果有获取bar宽度,加padding-right, 否则不加

All 7 comments

Hello @lopn, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!

padding-right 不能每次都加, 我觉得最合理的是应该先判断页面是否有滚动条,如果有获取bar宽度,加padding-right, 否则不加

https://github.com/NG-ZORRO/ng-zorro-antd/blob/6ae44678133a91467e568edc736e685aa8a565d8/components/core/services/nz-measure-scrollbar.service.ts#L18

修改成

  get scrollBarWidth(): number {
    if(document.body.scrollHeight <= (window.innerHeight || document.documentElement.clientHeight)){
         return 0;
      }

    if (isNotNil(this._scrollbarWidth)) {
      return this._scrollbarWidth;
    }
    this.initScrollBarWidth();
    return this._scrollbarWidth;
  }

同样的情况需要修复

同样的情况需要修复

Any news from that? I agree with the opinion of @lopn, before add a padding-right, verify if exists a scrollbar.

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Was this page helpful?
0 / 5 - 0 ratings