We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mask
scrollStrategy
Drawer
resize
按照设计规范,应当只在存在遮罩层时 block 底部内容区的交互
当前在无遮罩层时 click 操作是正常的。 若底部内容区可以滚动,则只要打开 Drawer ,无论是否有遮罩层,都无法滚动页面
click
原因是 Drawer 默认的 scrollStrategy 固定为了阻止页面滚动
private getOverlayConfig(): OverlayConfig { return new OverlayConfig({ panelClass: DRAWER_OVERLAY_CLASS, positionStrategy: this.overlay.position().global(), scrollStrategy: this.overlay.scrollStrategies.block(), }); }
应当根据 mask 输入来选择不同的 scrollStrategy 策略
此外,还有一个 angular/cdk 的已知问题,即 scrollStrategy 为阻止页面滚动时,如果打开抽屉后,缩放了窗口触发了 window:resize 事件,会导致页面可以滚动
angular/cdk
window:resize
原因是,抽屉的滚动策略生效是在抽屉打开时,若打开时就不需要滚动,则阻止页面滚动不会生效,详情见 angular/components#10841
可能需要抽屉内部监听 resize 事件来重新激活滚动策略
The text was updated successfully, but these errors were encountered:
No branches or pull requests
需要的改动
mask
输入来调整 overlayRef 的scrollStrategy
Drawer
组件内部监听resize
事件激活滚动策略问题描述
按照设计规范,应当只在存在遮罩层时 block 底部内容区的交互
当前在无遮罩层时
click
操作是正常的。若底部内容区可以滚动,则只要打开
Drawer
,无论是否有遮罩层,都无法滚动页面2023-10-09.16-56-03.mp4
原因是
Drawer
默认的scrollStrategy
固定为了阻止页面滚动应当根据
mask
输入来选择不同的scrollStrategy
策略此外,还有一个
angular/cdk
的已知问题,即scrollStrategy
为阻止页面滚动时,如果打开抽屉后,缩放了窗口触发了window:resize
事件,会导致页面可以滚动2023-10-09.17-06-30.mp4
原因是,抽屉的滚动策略生效是在抽屉打开时,若打开时就不需要滚动,则阻止页面滚动不会生效,详情见 angular/components#10841
可能需要抽屉内部监听 resize 事件来重新激活滚动策略
The text was updated successfully, but these errors were encountered: