Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Toolbar in directive, scroll-shrink not working #2751

Closed
twjacobsen opened this issue May 6, 2015 · 4 comments
Closed

Toolbar in directive, scroll-shrink not working #2751

twjacobsen opened this issue May 6, 2015 · 4 comments
Assignees
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Milestone

Comments

@twjacobsen
Copy link

Hi,

I've created a directive for a global nav-bar for my app, which creates a toolbar with some default stuff, and then transcludes page-specific content (actions etc).

Having the md-toolbar with md-scroll-shrink="" does not work, though.
As far as I can see, it never catches the $mdContentLoaded event, because the event is broadcast before my directive has loaded.

Is this a fault in my design, or is this an error in the way md-toolbar works?

@ThomasBurleson ThomasBurleson modified the milestone: Backlog May 28, 2015
@gamame
Copy link

gamame commented Jul 26, 2015

mdToolbar md-scroll-shrink is not working with ng-if
ng-if create new scope.
cannot catch $mdContentLoaded

@robertmesserle robertmesserle modified the milestones: 1.0-beta1, Backlog Aug 4, 2015
@naomiblack naomiblack modified the milestones: 1.0-beta1, 0.12.0 Aug 14, 2015
@topherfangio topherfangio added needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue labels Aug 24, 2015
@topherfangio
Copy link
Contributor

Any chance you guys could provide a demo of the exact issue so we can track it down more easily?

Thanks!

@gamame
Copy link

gamame commented Aug 25, 2015

http://codepen.io/anon/pen/jPgxqb

<md-toolbar md-scroll-shrink="" ng-if="true">
   ...   
</md-toolbar>
<md-content flex="">
  ...
</md-content>

@topherfangio topherfangio removed the needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue label Aug 25, 2015
@topherfangio
Copy link
Contributor

Confirmed; I have a decent idea of what the issue is and will look into it. Thanks!

@topherfangio topherfangio added type: bug and removed needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community labels Aug 25, 2015
topherfangio added a commit that referenced this issue Aug 31, 2015
Previously, the toolbar would fail to enable scroll shrinking
if the developer used an `ng-if` statement on the `md-toolbar`.

This commit allows usage of `ng-if` as well as watching the
`md-scroll-shrink` for changes so they can enable/disable
scroll shrinking.

Fixes #2751.
topherfangio added a commit that referenced this issue Aug 31, 2015
Previously, the toolbar would fail to enable scroll shrinking
if the developer used an `ng-if` statement on the `md-toolbar`.

This commit allows usage of `ng-if` as well as watching the
`md-scroll-shrink` for changes so they can enable/disable
scroll shrinking.

Fixes #2751.
@topherfangio topherfangio added the pr: merge ready This PR is ready for a caretaker to review label Aug 31, 2015
topherfangio added a commit that referenced this issue Sep 1, 2015
Previously, the toolbar would fail to enable scroll shrinking
if the developer used an `ng-if` statement on the `md-toolbar`.

This commit allows usage of `ng-if` as well as watching the
`md-scroll-shrink` for changes so they can enable/disable
scroll shrinking.

Fixes #2751.
kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
Previously, the toolbar would fail to enable scroll shrinking
if the developer used an `ng-if` statement on the `md-toolbar`.

This commit allows usage of `ng-if` as well as watching the
`md-scroll-shrink` for changes so they can enable/disable
scroll shrinking.

Fixes angular#2751. Closes angular#4394.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
Development

No branches or pull requests

6 participants