Sidenav

jseird pro premium priority asked 2 months ago

Using MDB5 1.1.0 / pro (not selectable here)

As the "close on click" functionality seems not to be available anymore I trigger clicks with an event listener calling

const sidenavInstance = new mdb.Sidenav(document.getElementById('sidenav-root-container'))
sidenavInstance.hide();

Works fine. I'd also expect the backdrop to be hidden though. Actually the backdrop is not hidden by calling sidenavInstance.hide(); and has to be hidden manually also.

Any plans on this? Thx


Magdalena Dembna staff premium commented 2 months ago

Can you extend the code snippet so it includes HTML markup as well? I couldn't introduce your issue. We auto-initialize sidenavs, so maybe replacing new mdb.Sidenav(element) with Sidenav.getInstance(element) will help with the backdrop issue?


jseird pro premium priority commented 1 months ago

I am refering to a feature that was available in version 4.* - therein the sidenav had a 'close-on-click' parameter. Every time you clicked a link in the navigation the sidenav slided out AND the backdrop disappeared. In 5.* 'close-on-click' is not available anymore and I had to mimic that feature manually. Though this is easy I'd expect the backdrop to be hidden also if I close the sidenav, since the backdrop's job in the first place is to give focus onto the sidenav - nothing else. Anyway the latter is also easy to mimic by hiding '.sidenav-backdrop' also. But such things should be mentioned in the doc. Migration from 4.* to 5.* is really far from being a drop in replacement - its more completely rebuilding every site :/


Arkadiusz Idzikowski staff commented 1 months ago

We currently have more sidenav modes than in version 4 and the implementation of 'close on click' feature may not be as simple as it was in the previous version. We will discuss this idea in our team.

As for the bug with the backdrop, please add more code so we can reproduce this problem on our end.


Please insert min. 20 characters.
Status

Open

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB 5
  • MDB Version: 1.0.0
  • Device: mac
  • Browser: safari, chrome
  • OS: osx
  • Provided sample code: No
  • Provided link: No
Tags