Hello! I’m using the code below to implement the opening of the side menu when the Android hardware menu button is pressed. I got an odd behaviour I can’t debug. When I press the hardware menu button the menu opens, but the next event is canceled. For instance:
- Tap hw menu button -> the menu opens
- Tap a menu entry -> nothing happens
- Tap a menu entry -> works correctly
Even the hw menu botton is canceled like so:
- Tap hw menu button -> the menu opens
- Tap hw menu button -> nothing happens
- Tap hw menu button -> the menu closes
Any idea?
.run(function($ionicPlatform, $ionicSideMenuDelegate) {
$ionicPlatform.ready(function() {
if (window.cordova) {
document.addEventListener("menubutton", onHardwareMenuKeyDown);
}
});
onHardwareMenuKeyDown = function () {
$ionicSideMenuDelegate.toggleLeft();
}
})