8000 bug(MatSidenav): Overlay scroll strategies do not work in sidenavs and drawers. · Issue #19846 · angular/components · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
bug(MatSidenav): Overlay scroll strategies do not work in sidenavs and drawers. #19846
Closed
@TrevorKarjanis

Description

@TrevorKarjanis

Reproduction

https://stackblitz.com/edit/angular-ivy-ng8reg?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce:

  1. Utilize an overlay or a component with an overlay in a mat-sidenav or mat-drawer that overflows.
  2. Declare cdkScrollable on the sidenav or drawer.
  3. Scroll the sidenav or drawer.

Expected Behavior

The overlay's scroll strategy is honored (e.g. the overlay remains fixed to its origin).

Actual Behavior

The sidenav's inner container, .mat-drawer-inner-container, handles the overflow and scrolls. Therefore, the cdkScrollable directive has no effect and the scroll strategy is not honored.

Environment

  • Angular: 10.0.2
  • CDK/Material: 10.0.1
  • Browser(s): Chrome 83.0.4103.116
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Related Issues

Fix

CdkScrollable is declared on mat-sidenav-content but not .mat-drawer-inner-container.

Workaround

Place the following in your global styles, and declare CdkScrollable on the mat-sidenav.

.mat-drawer, .mat-sidenav {
  &[cdk-scrollable], &[cdkScrollable] {
    .mat-drawer-inner-container {
      overflow: visible;
    }
  }
}

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/sidenav

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0