Topic: MDBSideNavCollapse animation and show problem

clickstudioltd priority asked 2 years ago


After updating to version 4.2.0, the MDBSideNavCollapse is misbehaving.

First off, show now is working the opposite way, because true means collapse and false means expand. If this is changed, then it should be called hide.

Second, the animation is buggy, I send an image for better explanation.

https://i.ibb.co/yd9xhMS/Untitled.gif

I've been upgrading to the newest React version almost immediately since the past 3 releases to resolve previous UI issues, but every time I've only found myself in more trouble than before...


Jacek Roszak pro commented 2 years ago

shouldBeExpanded defines only if the icon should rotate if it's set to true the icon is facing up, since the collapse is opened so the icon is suggesting to close a collapse.

I couldn't recreate your animation problem, please add a GH repo with this exact problem and integrations with the config you are currently using.


clickstudioltd priority commented 2 years ago

My bad, I meant the show attribute on MDBSideNavCollapse. Nevertheless, the functionality is flipped. I set it to true and it gets closed and when I set it to false it opens. Please confirm this in your own tests.

As for the animation, I can't really make a repo since this is a bigger setup, but to be at least helpful all I can provide is that I'm using Laravel + InertiaJS + MDBReact (with React 18.0) and I'm using the persistent layout feature by InertiaJS to show my dashboard and it's sidebar.

Needless to say, this was all working fine with version 4.1.0.


Jacek Roszak pro commented 2 years ago

I couldn't recreate the problem with show value, I've tested it when show is set to true the collapse opens so it works as it should.

Neither could I recreate the problem with animations, my guess would be a conflict with InertiaJS but that's just a guess, please consider creating a repo for example just with this specific problem.


clickstudioltd priority commented 2 years ago

You're right. I just tested with a fresh installation of MDBReact without InertiaJS, and it works correctly. Although I'm not sure Inertia is the problem or not since this was working fine just before 4.2.0 was released.


Jacek Roszak pro commented 2 years ago

I was trying to recreate this problem in many scenarios and still couldn't get your result. I would recommend checking InertiaJS changelog, maybe they had some kind of update that changed some logic.

Keep coding!


clickstudioltd priority commented 2 years ago

I kept coding and I realized I wasted my time fixing this issue since it was in fact a problem on your side. Kind of disappointing...


ntrinsec pro answered 2 years ago


I updated from MDB5 4.0.0 version to MDB5 4.2.0 and I have same issues with MDBCollapse (reverse show logic) and MDBAccordion (reverse initialActive logic). So initialActive is only hidden for me..


jlopez994 free answered 2 years ago


Hello, I updated to version MDB5 4.2.0 recently and I have a similar problem. Check out this link to see the current behavior:

https://nimb.ws/v7Y98j

I used the basic example from the documentation, adding it directly to the _app.tsx file

PD: I'm using nextjs v12.2.5 and react v18, and It was working perfectly until this version.


Stanisław Jakubowski staff commented 2 years ago

Hi! Unfortunately MDBCollapse doesn't work properly in the current version. We will fix it as soon as possible. Sorry for inconvenience.

Keep coding!


japan priority answered 2 years ago


I have a same problem, I had to reverse the logic 'show' and rendering menu is wrong. I'll try to prepare repository


Jacek Roszak pro commented 2 years ago

It would help us diagnose if the problem exists and how to solve this.


japan priority commented 2 years ago

Here is my sources ... https://github.com/Dede38SK/MDBsideNav SidenavMenu worked fine, after update Kit 4.1.0 to 4.2.0, logical of show NavCollapse is inverse and rendering is odd.


Jacek Roszak pro commented 2 years ago

Thanks for providing a repo, we'll investigate the problem.



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 React
  • MDB Version: MDB5 4.2.0
  • Device: PC
  • Browser: Mozilla Firefox
  • OS: Windows 10
  • Provided sample code: Yes
  • Provided link: Yes