Topic: Can't Swipe Away the SideNav

ijabit free asked 7 years ago


In your SideNav, once you swipe the SideNav over from the left to the right, you can't swipe it back unless you start with your finger on the right half of the screen. When the SideNav and overlay is displayed, you should be able to grab the SideNav from anywhere and swipe it away again. You can see what I'm talking about here.

ijabit free answered 7 years ago


Bartłomiej Malanowski: That goes against all feedback I've heard from MDB thusfar. All forum posts and communication from MDB has stated that MDB4 is a new product and that MDB3 would still be supported. Are you now saying that MDB is officially dropping all support for MDB3? Where is that documented? Michal stated that you would be releasing an updated version of MDB3 back in July here: http://mdbootstrap.com/forums/topic/fixed-sidenav-not-compatible-with-closeonclick/ He states again here that you continue to maintain MDB3: http://mdbootstrap.com/forums/topic/bugs-in-mdb3/ It's plainly spelled out: "Right now we maintain MDB3 Pro (for Bootstrap 3) and MDB4 Free and Pro (for Bootstrap 4)" On your main page here: http://mdbootstrap.com/material-design-for-bootstrap/ You say "Thanks to MDB you can take advantage of all feature of newest Bootstrap 4 or, if you prefer, use mature and still marvelous Bootstrap 3." How can you continue to sell MDB3 if it's no longer supported? On your MDB 3 sales page here: http://mdbootstrap.com/product/material-design-for-bootstrap-3-pro/ You mention under "Premium support": "All MDB PRO users service request and questions have priority support. Premium support gives you almost immediate solution.". I'm very disappointed in your response.

MDB 3 will be no longer updated

ijabit free answered 7 years ago


I still don't see a new version of MDB 3. Did you only fix this in MDB4? My understanding is that MDB3 would still be maintained and receive bug fixes. Thanks.

Solution:
$(".button-collapse").sideNav();

$(document).ready(function () {
	$(document).hammer().on('swipeleft', function () {
		$('.button-collapse').sideNav('hide');
	})
	$(document).hammer().on('swiperight', function () {
		$('.button-collapse').sideNav('show');
	})
});


This will be fixed in the new version of MDB, which be released soon

ijabit free answered 7 years ago


It's been another month, any idea of when it will be completed? Thanks!

The problem is still on our TODO list. Sorry for long time to wait

ijabit free answered 7 years ago


Any updates on this?

Michal Szymanski staff answered 7 years ago


Unfortunately not. We have a problem to make it working correctly on all kind of devices. We still try to improve it, I'm sorry.

ijabit free answered 7 years ago


Hi Michal, is this now fixed?

Michal Szymanski staff answered 7 years ago


Next week we want to release new update for Bootstrap 4 alpha 3. We'll try to fix it at the same time. Thanks :)

ijabit free answered 7 years ago


Any idea when this will be fixed? Another good example of how it should work is using the Amazon Android app. BTW: Your SideNav is awesome!

ijabit free answered 7 years ago


Thanks Michal, that does help. But I was thinking you could swipe it away by touching the side nav itself and swiping left, instead of starting past the side nav. Kind of like how the Skype app works on my phone: https://1drv.ms/v/s!AlDWspfXHYVqiN07eSmXXw3pSpt-Qw

Michal Szymanski staff answered 7 years ago


Now I see the problem is only with tablets. Actually it works but with bigger screen you need much longer swipe than on mobile, what of course isn't functional and shouldn't work like this. We'll improve it. If you need a quick workaround( which unfortunately isn't perfect) in mdb.js find 2 lines dragTarget.css({width: '50%', right: '', left: 0}); and change the width from 50% to 90% dragTarget.css({width: '90%', right: '', left: 0});

ijabit free answered 7 years ago


Yes, I just created a brand new MVC site and added in all of the MDB stuff. You can access it here: http://mdb341test.azurewebsites.net/ I'm seeing the exact same behavior with device emulation in Chrome (see my original post) and on my iPad 2 using Safari, but I don't think the browser makes a difference in this case. You can swipe away the sidenav if you start swiping from the right half of the screen, but as soon as you start the swipe anywhere in the left half of the screen it doesn't work. Looking through your code, I think it has something to do with the .drag-target being only 50% width. And the pan and panend events are tied to the .drag-target. So if you click somewhere to the left half of the screen and try to pan left it won't work because the events aren't firing. Here is a video of the swipe action not working if you start on the left half of the screen: https://1drv.ms/v/s!AlDWspfXHYVqiN0FHMEjFSVxk_eQ9Q

Michal Szymanski staff answered 7 years ago


Even if you put a sidenav in a completely new project with mdb 3.4.1 ? It should works fine. What devices and browser do you use?

ijabit free answered 7 years ago


I just updated to MDB 3.4.1 and the sidenav still doesn't swipe away. Will you be fixing this issue for MDB 3 as well? Thanks! Jim

Michal Szymanski staff answered 7 years ago


It's fixed in 4.0.1. Our demos aren't updated yet.

ijabit free answered 7 years ago


Is this fix supposed to be included in the 4.0.1 release? In your current demos, I can't swipe away at all now. I have to tap somewhere in the overlay to get rid of it, hardly an intuitive way to get rid of the side nav!

Michal Szymanski staff answered 7 years ago


We'll improve it. Thanks for info.

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: Yes
Tags