-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
MatSidenavContainer scroll events not working as documented #10884
Comments
it's still broken in 6.1.0. Here the example: |
It looks like the query listener is being added too soon in the example, it should be deferred until Would anyone like to send a PR updating the example? |
@stevo-knievo ok sorry I think I misunderstood. So there's a couple things. First, in your demo the sidenav content is not actually the element that's scrolling. The sidenav container is expanding to fill its content and the body is scrolling. You would need to size it so the content element is the element that's scrolling. The second issue appears to be a problem with Angular Material. It looks like we only grab the CdkScrollable when the Here's a version of your example where I've absolutely positioned the sidenav container to restrict its height and added the |
…ing content element * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes angular#10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
…ing content element * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes #10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
…ing content element * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes #10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
…ing content element * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes #10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
…ing content element (#11517) * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes #10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
…ing content element * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes angular#10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
…ing content element * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes angular#10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
Reopening the issue since the PR got in by accident and had to be reverted. |
…ing content element (#11706) This is a resubmit of #11517 which got in by accident. * Fixes the `MatSidenavContainer.scrollable` being undefined if the consumer has set the `mat-sidenav-content` themselves. The issue comes from the fact that we only query for scrollables inside the drawer's own view, but not inside the projected content. * Fixes the example in the sidenav docs accessing the scrollable too early. Fixes #10884. BREAKING CHANGE: the constructor signature of the `MatDrawerContent` and `MatSidenavContent` has changed.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Able to react to scrolling inside the
<mat-sidenav-container>
What is the current behavior?
Unhandled Promise rejection: Cannot read property 'scrollable' of undefined ; Zone: ; Task: Promise.then ; Value: Error: Cannot read property 'scrollable' of undefined TypeError: Cannot read property 'scrollable' of undefined at new SidenavResponsiveExample
What are the steps to reproduce?
https://stackblitz.com/edit/angular-rgkuk8?file=app/sidenav-responsive-example.ts
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: