-
Notifications
You must be signed in to change notification settings - Fork 24.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
fix(aio): fix SideNav height and auto-close when necessary #21538
Conversation
You can preview 1633bad at https://pr21538-1633bad.ngbuilds.io/. |
1633bad
to
9d875f5
Compare
You can preview 9d875f5 at https://pr21538-9d875f5.ngbuilds.io/. |
aio/src/app/app.component.spec.ts
Outdated
navigateTo(doc); | ||
expect(sidenav.opened).toBe(false); | ||
|
||
resizeTo(sideBySideBreakPoint + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the beforeEach
we resize to sideBySideBreakpoint + 1
so isn't this line a noop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops! I meant resizeTo(sideBySideBreakPoint - 1)
😇
aio/src/app/app.component.spec.ts
Outdated
const sidenavDocs = ['api/a/b/c/d', 'guide/pipes']; | ||
const nonSidenavDocs = ['features', 'about']; | ||
|
||
beforeEach(() => resizeTo(sideBySideBreakPoint + 1)); // initially side-by-side |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be easier to follow if this was moved into the actual it
clauses
aio/src/app/app.component.spec.ts
Outdated
navigateTo('api/a/b/c/d'); | ||
expect(sidenav.opened).toBe(false); | ||
}); | ||
it('should close when click in gray content area overlay', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
click -> clicking
aio/src/app/app.component.spec.ts
Outdated
navigateTo('features'); | ||
expect(sidenav.opened).toBe(false); | ||
}); | ||
it('should close when nav to another guide page', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nav -> navigating
aio/src/app/app.component.spec.ts
Outdated
locationService.go(path); | ||
component.updateSideNav(); | ||
if (toggleSidenav) { | ||
hamburger.click(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make the tests more readable if the toggle was in its own helper function.
Note that this could then be used in the other tests that are currently doing this the "long" way below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the navigateTo()
helper can already be used in these other tests as well, but I totally agree that making it more explicit (instead of a boolean arg in an unrelated helper 😁) is worth the extra fixture.detectChanges()
💯
Moved to a separate helper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this really: https://github.com/angular/angular/pull/21538/files#r162666308
Since we specify `bottom: 0`, specifying the height is unnecessary and leads to wrong height (unless updated) on narrow screens where the topbar height is decreased. Partly addresses angular#21520.
Partly addresses angular#21520.
9d875f5
to
67054e1
Compare
Updated. PTAL |
You can preview 67054e1 at https://pr21538-67054e1.ngbuilds.io/. |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
You can preview 2d63760 at https://pr21538-2d63760.ngbuilds.io/. |
2d63760
to
67054e1
Compare
You can preview b5f6ef5 at https://pr21538-b5f6ef5.ngbuilds.io/. |
b5f6ef5
to
67054e1
Compare
Not sure what happened with the CLA, @gkalpak ?? |
Sorry, about the CLA. We were trying something out with @jbogarthyde and @dennispbrown 😁 |
Since we specify `bottom: 0`, specifying the height is unnecessary and leads to wrong height (unless updated) on narrow screens where the topbar height is decreased. Partly addresses angular#21520. PR Close angular#21538
) Partly addresses angular#21520. PR Close angular#21538
Since we specify `bottom: 0`, specifying the height is unnecessary and leads to wrong height (unless updated) on narrow screens where the topbar height is decreased. Partly addresses angular#21520. PR Close angular#21538
) Partly addresses angular#21520. PR Close angular#21538
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. |
This PR addresses points 2 and 3 of #21520.