Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

New sidenav #310

Merged
merged 9 commits into from
Feb 6, 2018
Merged

New sidenav #310

merged 9 commits into from
Feb 6, 2018

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented Nov 1, 2017

This PR implements the new left nav. This is the exact same PR as #300 just merged w/ @mmalerba latest changes.

@amcdnl amcdnl requested a review from jelbourn November 1, 2017 15:41
@amcdnl amcdnl mentioned this pull request Nov 1, 2017
@mmalerba
Copy link
Collaborator

mmalerba commented Nov 1, 2017

I see a couple of issues here:

  • In mobile mode, the document does not receive scroll events (this is needed for the address bar to scroll up on phones (compare to https://material2-docs-dev.firebaseapp.com/components/autocomplete/overview where the document does receive scroll events)
  • In mobile mode, there seems to be a gap between the 2 toolbars
    docs-site1
  • In desktop mode, there is a gap at the bottom (below the footer)
    docs-site2
  • In desktop mode, when I expand the sidenav both the content and the sidenav scroll (the content doesn't actually need to scroll, it's only scrolling because of the sidenav)
    docs-site3

@amcdnl
Copy link
Contributor Author

amcdnl commented Nov 1, 2017

  1. So that is tricky because of the sticky positioned items. I was able to work around this by adding a hack that will automatically hide the browser address bar for you.
  2. Fixed
  3. Fixed
  4. I'm not sure its possible to fix this given the nature of things that need to scroll / push in this scenario. Open to suggestions though.

@amcdnl
Copy link
Contributor Author

amcdnl commented Dec 11, 2017

tag @jelbourn

@jelbourn jelbourn requested a review from mmalerba December 12, 2017 17:09
@jelbourn
Copy link
Member

@mmalerba can you review this?

@mmalerba
Copy link
Collaborator

Sorry, I thought this wasn't ready since it has conflicts. @amcdnl Can you resolve it so I can bring up a demo?

# Conflicts:
#	src/app/pages/component-sidenav/component-sidenav.ts
#	src/app/shared/table-of-contents/table-of-contents.scss
#	src/index.html
@amcdnl
Copy link
Contributor Author

amcdnl commented Jan 21, 2018

@mmalerba - merged :)

@jelbourn
Copy link
Member

@mmalerba you can merge this directly once it has your approval

@mmalerba
Copy link
Collaborator

@amcdnl could you take a stab at trying to fix the mobile scrolling and the slightly too tall page? I talked to Jeremy about whether its worth the trade-off for a prettier sidenav, and we'd really prefer not to lose these features (especially the mobile scrolling)

code-wise looks good minus the couple newline nits

@amcdnl
Copy link
Contributor Author

amcdnl commented Feb 4, 2018

@mmalerba - I believe I had addressed all your feedback and am ready for review! :)


.docs-component-viewer-nav-content {
background: rgba(0, 0, 0, $nav-background-opacity);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be the foreground color instead of always black?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to make it a slight lighter accent of the current background. This is mainly done like this for different themes.


.docs-component-viewer-sidenav {
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, .26);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above


.mat-drawer {
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, .26);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

<hr *ngIf="!last" />
</nav>
</div>
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: \n

</div>
</mat-sidenav-container>
</mat-sidenav-container>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: \n

@mmalerba
Copy link
Collaborator

mmalerba commented Feb 5, 2018

Awesome, it looks much better now. It looks like this one is still an issue:

  • In desktop mode, when I expand the sidenav both the content and the sidenav scroll (the content doesn't actually need to scroll, it's only scrolling because of the sidenav)
    docs-site3

I don't think it's a huge deal, I would be ok submitting the PR if it's too difficult to fix, but it would be nice to fix.

@amcdnl
Copy link
Contributor Author

amcdnl commented Feb 5, 2018

@mmalerba - The nav is always a fixed 75vh so it should be scrolling in this case. The body scrolling in this case is unexpected and I thought I had fixed this. Let me take another look and let you know.

@amcdnl
Copy link
Contributor Author

amcdnl commented Feb 5, 2018

@mmalerba - Really the only good fix for this would be to remove the scrollbar from the side nav and just let it push down. I implemented the scrollbar like this similar to the google api docs that I used as an example. Let me know how you would like to proceed.

@mmalerba
Copy link
Collaborator

mmalerba commented Feb 5, 2018

we can't do something like this?

max-height: calc(100vh - <header-height> - <footer-height>)

@mmalerba mmalerba merged commit 81e8698 into angular:master Feb 6, 2018
@amcdnl amcdnl deleted the new-sidenav2 branch February 6, 2018 19:08
@amcdnl
Copy link
Contributor Author

amcdnl commented Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants