-
Notifications
You must be signed in to change notification settings - Fork 4k
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
how to remove the right padding of body when show a modal #1422
Comments
同样关注ing... |
It seems that it was fixed in recent commits. See https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/modal/nz-modal.component.ts. private changeBodyOverflow(): void {
const openModals = this.modalControl.openModals;
if (openModals.length) {
this.renderer.setStyle(this.document.body, 'padding-right', `${this.nzMeasureScrollbarService.scrollBarWidth}px`);
this.renderer.setStyle(this.document.body, 'overflow', 'hidden');
} else {
this.renderer.removeStyle(this.document.body, 'padding-right');
this.renderer.removeStyle(this.document.body, 'overflow');
}
} But I think the padding should be added before the modal shows up, just like antd. |
@yzy1197988245 @hemiaoio |
@wilsoncook YES. Now open the modal window, the back window will shake, visually feel uncomfortable |
@wilsoncook YES |
|
padding-right 不能每次都加, 我觉得最合理的是应该先判断页面是否有滚动条,如果有获取bar宽度,加padding-right, 否则不加 |
修改成
|
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. |
What problem does this feature solve?
每次show modal 的时候右边多一个空白,body不会出现滚动条
What does the proposed API look like?
加一个配置项
The text was updated successfully, but these errors were encountered: