[BUG] Ionic Beta.14: can't close sideMenu with swipe

Hi,

With the new beta 14 sideMenu can’t be closed with a swipe effect on a real device or emulator Android.
Beta 13 works correctly.

How to reproduce:

  • $ ionic start myApp sidemenu
  • $ cd myApp; ionic platform add android;
  • $ ionic run android

Do you prefer I open a new issue on Github ?

Hmm, I’m not seeing it on my end.
What device and android version are you using?

  • Android 4.4.4
  • Nexus 5

Have you changed anything else?
I just ran this on a nexus 5 running 4.4 and it worked fine,

$ ionic start myApp sidemenu
$ cd myApp; ionic platform add android;
$ ionic run android

I use theses commands in new folder.
Works fine in browser with ionic serve but not with APK after ionic run android

For me, this problem occurs only when I set enable-menu-with-back-views=“true” on android 4.4.3

Hmm, still not seeing this on my side.
Could remote debug this with chrome and see if any errors are coming up?

I have the same problem with the same steps:
$ ionic start myApp sidemenu
$ cd myApp; ionic platform add android;
$ ionic run android

in a real device ( HTC One m7, Android 4.4 ), I am using android 4.4.2 (API 19) to build the project.
there are not errors in chrome.

Unfortunately, no error is returned, the touch event is just canceled :

touchstart x:338, y:318
touchmove x:317, y:319
touchcancel

(I’m testing on HTC One android 4.4.3)

Hey there,

i have a problem with the sidemenu.
If i reload my app in desktop browser the “sidemenu dragging” works, but only in that view.

But i look deeper into it today, maybe it is my fault.

No error with remote debug :-/

How get these informations please @JeremyM ?

@zckrs it is just a listener that I added in my application to debug

document.addEventListener('touchstart', function (event) {
        var touch = event.touches[0];
        console.log("touchstart x:" + touch.pageX + ", y:" + touch.pageY);

        //dirty workaround for Android
        if ($ionicSideMenuDelegate.isOpenLeft()) {
            event.preventDefault();
        }
});

I also found 2 bug reports for this problem


1 Like

Will you solve this bug @mhartington?

@danicomas
mhartington is responsible for the forum and communication to the ionic team.

when… the ionic team will solve the problem…
And when there are already issues on github … the ionic team will take care of them.

So let them do their business :wink: .

And while there is a workaround keep calm.

// WORKAROUND FOR IONIC BUG ON ANDROID
document.addEventListener('touchstart', function (event) {
  if ($ionicSideMenuDelegate.isOpenLeft()) {
    event.preventDefault();
  }
});
4 Likes

Nice work around @bengtler

Correct, if the issue is up on Github, the team will get to it.
Plus remember, this is an Open Source Project, pull requests are always welcomed.

1 Like

I’m sorry i’m a complete Ionic newb. I’m experiencing the same issue listed here, where is it that I would insert the workaround code listed?

Thanks in advance!

I have it inserted in the run function:

app.run(function($ionicPlatform, $ionicSideMenuDelegate, $rootScope, $state) {
    $ionicPlatform.ready(function() {
        if (window.cordova && window.cordova.plugins.Keyboard) {
            window.cordova.plugins.Keyboard.disableScroll(true);
        }

        document.addEventListener('touchstart', function (event) {
            // workaround for Android
            if ($ionicSideMenuDelegate.isOpenLeft()) {
                event.preventDefault();
            }
        });
    });
});
5 Likes

All plugged in and working great. Thanks a million!

1 Like

Same issue here.
I’m able to open the menu with a swipe gesture from the left to the right, but I can’t close it with a gesture from the right to the left.
LG G3, stock, Android 4.4.2

Edit: btw the workaround doesn’t work on my device too
Edit: sorry, it works well with the workaround, hoping a fix for the next release

1 Like