Allow to programmatically open and close the SideNav
See original GitHub issueIf I am not mistaking, the SideNav cannot be opened or closed programmatically. This could be very useful, for example when we use a framework like Angular or Meteor, when the page is not reloaded after a click on a link.
Current workaround is to use something like $('#sidenav-overlay').trigger( "click" );
Issue Analytics
- State:
- Created 9 years ago
- Comments:14
Top Results From Across the Web
Open/Close sidenav from another component - Stack Overflow
I had the same problem using. I resolved it like this. SidenavService import { Injectable } from '@angular/core'; import { MatSidenav } from ......
Read more >Sidenav - Angular Material
A <mat-sidenav> can be opened or closed using the open() , close() and toggle() methods. Each of these methods returns a Promise<boolean> that...
Read more >Closing the Angular Material Sidenav Post Navigation
After clicking on Accounts we want our MatSidenav to close. Approach. Create a template variable referencing the MatSidenav instance: <mat- ...
Read more >Programmatically hide and show sidebar in split view
This API allows us to programmatically control visibility of the ... If they delete the request in the end, we will show the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added in a409efa5e12d054948a4554171d95ea598380317
(function($){ $(function(){ $(‘.button-collapse’).sideNav({ closeOnClick: true }); }); })(jQuery);
pass closeOnClick: true on SideNav initialization …it will work