Topic: SideNav only opens on second click

root-nine priority asked 5 years ago


I have a SideNav hidden by default which I display via the SlideOut function. After upgrading from MDB Pro 4.5.16 to 4.7.5 I´m facing the following problem:

This is the behavior:

  • First click: SideNav opens without animation
  • Closing the SideNav
  • Second click: SideNav does not open
  • Third click: SideNav opens as expected with animation
  • Closing the SideNav
  • Same again: SideNav only opens on every second click

In Chrome debugger I see that on the second click the transform-style does not change from translateX(100%) to translateX(0%). That happens on the third click.


Andrew Ford priority commented 5 years ago

I've been noticing this too.


steute free answered 5 years ago


Same issue with MDBReact Pro.


Piotr Glejzer staff commented 5 years ago

Is it still existing this problem? Have a nice day.


mladelfa free answered 5 years ago


Greeetings, We are using version 4.7.5 and we face the double-click sidenav problem. We've tried @Piotr Glejzer solution and it didn't work. We've commented out line 17111 from mdb.js _this3.menuOut = true; and it works with one click, but the first time we have no display animation.

Cheers


Piotr Glejzer staff commented 5 years ago

Thanks for the report. We will check this problem as soon as possible.


Piotr Glejzer staff commented 5 years ago

I already fixed this. It will be fix with 4.7.6 version. Are you want fix now?


themarketpeople free commented 5 years ago

@Piotr Glejzer Hi i am using mdb pro 4.7.5 and used the mdb.js file can you tell me how to fix the issue. Thanks


Piotr Glejzer staff commented 5 years ago

We already fix this with 4.7.6 version. Please download it and check it.


Benoit KOPP pro answered 5 years ago


Hello,

I was thinking that the behavior got weird in that last release. It's like 1 hour i'm looking in the code and I figured out that the line mentionned by @Piotr Glejzer is the one triggering the problem. (line 17120 in mdb.js).

When do you think you'll be able to release a fix for this ?

Thanks.


Piotr Glejzer staff answered 5 years ago


Yes we know that and we will try to fix this in the next release but there is a workaround for this. You have to remove this code from sidenav.js from a method/key openOnClick at if/else statement:

  this.menuOut = true;

there is in 439 line (src folder) or 401 (dist or module folder).


root-nine priority commented 5 years ago

Thx for your answer, will try the workaround


reza pro commented 5 years ago

I encountered this problem, after deleting another part, I deleted it. I tested this solution and answered it Animation does not run for the first time



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: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.7.4
  • Device: PC
  • Browser: Chrome, Edge, Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No