question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

md-sidenav align="end" in child component causes horizontal scrolling

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

md-sidenav in child component shouldn’t behave differently to md-sidenav in component with no child

What is the current behavior?

if you move md-sidenav with align="end" to a child component to the one housing md-sidenav-layout, horizontal scrolling is introduced when sidenav is closed.

What are the steps to reproduce?

THE FOLLOWING WORKS PERFECTLY:

<md-sidenav-layout fullscreen>
    <md-sidenav opened="true" align="end" #right style="width: 200px;">
        <button md-raised-buttton (click)="right.close()">CLOSE</button>
    </md-sidenav>
</md-sidenav-layout>

To check:

  1. Click close button
  2. Attempt to drag window horizontall. Nothing happens

NOW, WITH SIDENAV IN CHILD COMPONENT:

PARENT.HTML

<md-sidenav-layout fullscreen>
    <app-child></app-child>
</md-sidenav-layout>

CHILD.HTML

<md-sidenav opened="true" align="end" #right style="width: 200px;">
    <button md-raised-buttton (click)="right.close()">CLOSE</button>
</md-sidenav>

To simulate, repeat step above. Note that screen scrolls horizintally but the width of the md-sidenav.

screen shot 2016-12-11 at 3 35 02 pm

What is the use-case or motivation for changing an existing behavior?

i utilize multiple sidebar and want to encapsulate them as standalone components

Which versions of Angular, Material, OS, browsers are affected?

angular 2.2.3 material: alpha 11 os: osx 10.12.1 browser: chrome 55.0.2883.75 (64-bit) (but i get the same issue on any browser i’ve tried)

Is there anything else we should know?

nope, thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mumumilkcommented, Aug 22, 2017

Had the same problem, got solved by giving the md-sidenav a position: fixed.

0reactions
angular-automatic-lock-bot[bot]commented, Jul 29, 2022

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

md-sidenav align="end" in child component causes horizontal ...
if you move md-sidenav with align="end" to a child component to the one housing md-sidenav-layout , horizontal scrolling is introduced when ...
Read more >
Angular 6 - Material sidenav horizontal scroll - Stack Overflow
Just trying to enable horizontal scrolling inside of mat-side-nav... Update: Attempted using "white-space: nowrap" to the styling. Only affected ...
Read more >
Well-controlled scrolling with CSS Scroll Snap - web.dev
Here scroll snapping ensures at the end of scrolling an image horizontal center is aligned with the horizontal center of the scroll ...
Read more >
Horizontal scrolling - Webflow University
Horizontal scrolling fully engages visitors by using a unique interaction that changes their scrolling experience from vertical to right to left.
Read more >
How to find the cause of horizontal scrollbars - Polypane
To find out which elements cause a horizontal scrollbar, you can use the devtools to delete elements one by one until the scrollbar...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found