Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] modal padding-right #1720

Closed
lopn opened this issue Jun 25, 2018 · 7 comments · Fixed by #2006
Closed

[bug] modal padding-right #1720

lopn opened this issue Jun 25, 2018 · 7 comments · Fixed by #2006
Assignees

Comments

@lopn
Copy link

lopn commented Jun 25, 2018

this.renderer.setStyle(this.document.body, 'padding-right', `${this.nzMeasureScrollbarService.scrollBarWidth}px`);

@ng-zorro-bot
Copy link
Collaborator

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!

@lopn
Copy link
Author

lopn commented Jun 25, 2018

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

@lopn
Copy link
Author

lopn commented Jun 25, 2018

修改成

  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;
  }

@ppjjzz
Copy link
Contributor

ppjjzz commented Aug 1, 2018

同样的情况需要修复

1 similar comment
@AnhuiWdan
Copy link

同样的情况需要修复

@DouglasOGarrido
Copy link

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

wilsoncook added a commit to wilsoncook/ng-zorro-antd that referenced this issue Aug 18, 2018
wilsoncook added a commit to wilsoncook/ng-zorro-antd that referenced this issue Aug 18, 2018
wilsoncook added a commit to wilsoncook/ng-zorro-antd that referenced this issue Aug 19, 2018
@lock
Copy link

lock bot commented Sep 7, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 7, 2019
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants