Skip to content
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

md-sidenav-collapse must have ref to the md-sidenav (and more) #484

Open
djensen47 opened this issue Oct 3, 2017 · 3 comments
Open

md-sidenav-collapse must have ref to the md-sidenav (and more) #484

djensen47 opened this issue Oct 3, 2017 · 3 comments

Comments

@djensen47
Copy link

At first glance, this seems okay. However, I'm seeing a couple of problems:

  1. There is logic required for the proper operation of md-sidenav contained in the logic for md-sidenav-collapse

Which leads me to...
2. If a toolbar (or whatever else you're using to toggle the sidenav) is not defined in the same view/component as the sidenav, you cannot use md-sidenav-collapse.

I have a situation where I have different toolbars for different views and some of those might need to open the sidenav while others will not. I have considered using the Event Aggregator to solve this but it appears there is some important logic contained within md-sidenav-collapse which might be nice to move to sidenav.

@Thanood
Copy link
Collaborator

Thanood commented Oct 9, 2017

You're right.
The problem is: Materialize's sidenav needs a button. It's (IMO unfortunately) all initialized using that button.

While this is not a huge problem with single page apps that actually consist of a single page where everything is globally accessible, it fails with separated views.

A workaround may indeed be the EventAggregator with the receiver triggering a click on an invisible button. It's really not pretty, though..

@djensen47
Copy link
Author

Yeah, I'm using an EventAggregator now but I've switched to using the MDC temporary drawer. I think the work you and this project have done is great. Unfortunately, there are some weird decisions (related and unrelated to this issue) from the Materialize team making it more and more difficult to use.

@Thanood
Copy link
Collaborator

Thanood commented Oct 9, 2017

Thanks for the kind words. 😃
And I think you're right again.. Some decisions are ... well, you can see that the library is a bit old maybe.

Let's hope the best for their 1.0 refactor.

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

No branches or pull requests

2 participants