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

关于美化滚动条所带来Modal细节问题 #2612

Closed
cipchk opened this issue Dec 10, 2018 · 3 comments
Closed

关于美化滚动条所带来Modal细节问题 #2612

cipchk opened this issue Dec 10, 2018 · 3 comments

Comments

@cipchk
Copy link
Member

cipchk commented Dec 10, 2018

现状

Modal 打开以后会根据 NzMeasureScrollbarService 来计算,但是这只是针对不同浏览器的结果,事实上若美化滚动以后这种方法也会失效,这会导致美化以后的结果不正确。

方案

针对 NzMeasureScrollbarService 增加一个额外的类名,例如:class="nz-NzMeasureScrollbarService",用户可以针对 nz-NzMeasureScrollbarService 增加美化样式,从而确保美化后滚动条宽度。

autoBodyPadding

autoBodyPadding 是否自动给body加上padding及overflow来隐藏滚动条,但过于直接,对于关闭 autoBodyPadding 情况,可以考虑给 body 增加一个类名,例如:<body class="nz-modal-open">,这给已打开 Modal 以后有更多的想象空间。

@kzzc
Copy link

kzzc commented Dec 12, 2018

顺带提个问提,
页面上存在多个modal或drawer时,关闭其中一个,会将美化滚动条的状态样式"overflow: hidden; padding-right: 17px;"清除掉.
应该在存在多个drawer或modal的情况下,仅在关闭最后一个的时候清除body上的附加style

@nzbin
Copy link

nzbin commented Dec 25, 2018

@cipchk 个人建议能否去除 ng-alain 的滚动条美化,在 Mac 上体验不好

@cipchk
Copy link
Member Author

cipchk commented Dec 25, 2018

@nzbin 这无关乎 ng-alain (有对应的开关可以关掉美化滚动条),作为UI组件库理应有更多的弹性。

hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Feb 2, 2019
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Feb 13, 2019
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this issue Apr 9, 2020
* refactor(module:modal): refactor block scroll strategy

close NG-ZORRO#2612

* docs(module:modal): update docs

* test(module:modal): update cases for scrollbar

* refactor(module:modal): use OnPush change detection

close NG-ZORRO#2643, close NG-ZORRO#2656

* fix(module:modal, drawer): IE/Edge SVG doesn't support `blur`/`focus` method

close NG-ZORRO#2388

* fix(module:modal): fix animations

* refactor(module:modal): switch to Default change detection

* docs: add temporary use case for IE

* fix: scrollblock style
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
* refactor(module:modal): refactor block scroll strategy

close NG-ZORRO#2612

* docs(module:modal): update docs

* test(module:modal): update cases for scrollbar

* refactor(module:modal): use OnPush change detection

close NG-ZORRO#2643, close NG-ZORRO#2656

* fix(module:modal, drawer): IE/Edge SVG doesn't support `blur`/`focus` method

close NG-ZORRO#2388

* fix(module:modal): fix animations

* refactor(module:modal): switch to Default change detection

* docs: add temporary use case for IE

* fix: scrollblock style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants