Topic: SideNav only opens on second click

Ian G. Morris free asked 5 years ago


Expected behavior Expect to click on the .button-collapse button and expose the sidenav.

Actual behavior After click the button the first time, the button now requires two clicks in order to expose it.

Resources (screenshots, code snippets etc.) The following link is an example of the issue

https://help.deacom.com/sandbox/TOPHAT_Backup/v0.9/


MDBootstrap staff answered 5 years ago


Hi Ian,

I belive you understand that our component of such easy to implement funcionality is not a problem here. If you check many sites made with our top and side navigations you will see that this can be implemented properly. In your case I can tell that your implementation of this mdb element is correct if this is only code you are using to work with this .button-collapse. However your project might work differently because of other implementations I can not check. Please understand that this is not mdb's fault that this single example of your development might have problem with our libraries.

But in your case maybe trigger click on this button after sidebar is hidden? It should solve this weird behaviour of sidebar.

Best Regards, Piotr


Ian G. Morris free answered 5 years ago


Piotr,

I have reduced the libraries being loaded to the default mdbootstrap requirements and the script (app.js).

The code below is only reference once, after using the sidenav button once, it now requires two clicks.

// SideNav Button Initialization $(".button-collapse").sideNav({ edge: 'left', // Choose the horizontal origin closeOnClick: true / });


MDBootstrap staff answered 5 years ago


Hi Ian,

A problem like this occurs when you initialize sidebar twice. Try to check and be sure you don't do this in your code. In the example you provided I can not find a problem with our package because you are using a lot of different scripts. I cannot check every interaction between them. If you want me to check your implementation of our component, please copy your html code to our snippet

Best Regards, Piotr



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.2
  • Device: Windows PC
  • Browser: Chrome 75.0.3770.80
  • OS: Windows 10 Pro 64bit
  • Provided sample code: No
  • Provided link: Yes