question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to programmatically open and close the SideNav

See original GitHub issue

If 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:closed
  • Created 9 years ago
  • Comments:14

github_iconTop GitHub Comments

13reactions
acburstcommented, Jan 23, 2015

Added in a409efa5e12d054948a4554171d95ea598380317

// Show sideNav
$('.button-collapse').sideNav('show');
// Hide sideNav
$('.button-collapse').sideNav('hide');
7reactions
basiljose1commented, Dec 1, 2016

(function($){ $(function(){ $(‘.button-collapse’).sideNav({ closeOnClick: true }); }); })(jQuery);

pass closeOnClick: true on SideNav initialization …it will work

Read more comments on GitHub >

github_iconTop 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 open & close behavior - StackBlitz
Sidenav open & close behavior.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found