Material: NavigationDrawerController and menu button

Created on 20 Nov 2017  路  26Comments  路  Source: CosmicMind/Material

if press on menu button on navigation bar and move finger to left, the left view controller will close, but the content view stay on screen, and block the user interactions.

nov-20-2017 15-54-39

good first issue help wanted high priority investigate material

All 26 comments

Hey! I tried the sample project now, NavigationDrawerController sample, and all seems to work. Can you confirm using the latest Material version and with the sample this issue exists? If not, we will need to investigate your setup. Thank you!

i'm use the last version of Material (2.12.16) and the issue exits for left and right view controller.

Have you tried it with the sample, because I did and there is not an issue.

yes i tried it with the sample, and this a gif from your sample.

nov-20-2017 17-38-10

This is not happening to me with the latest and same simulator. Can you ensure that you are not loading a cached copy or something corrupt, because I cannot reproduce this issue?

you swipe to left when tap on left UIBarButtonItem ?

Here is what I get:

navdrawer

I am closing this issue for now. If you send me a reproducible project, I will reopen this. Thank you!

i think you don't understand how to bring this bug, please, use the gesture on the menu button EXACTLY as I was showing. As if you want to throw the button off the screen.

Ah I see, well two things. One you are using a normal UINavigationController, the sample used a Material NavigationController. Second, you are doing this on a simulator, which means you might be breaking the touch events when the cursor goes off the simulator screen area. I would check this on a real device and send me a reproducible project. If you need any further help, let me know :)

this issue is exists for real devices, and i replaced a normal UINavigationController with Material NavigationController the issue still exists for simulator and real device, and this is a reproducible project.

please make look for two methods in NavigationDrawerController handleLeftViewPanGesture(recognizer:) handleRightViewPanGesture(recognizer:)

the methods closeLeftView(velocity:) and closeRightView(velocity:) has called before the side view controller has opened.

Thank you, I will take a look :)

I see now what you are saying. I can reproduce the issue. I'll take a look :)

I had the same issue, you must add a UITapGestureRecognizer like this: menuButton.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleMenuButton)))

@ToonvanStrijp I will add fix that removes the need to add the UITapGestureRecognizer.

Hi @danieldahan, have you had time to look at this yet? I see this behaviour in my App too.

Hi @danieldahan, I have same issue, is a problem in iOS 10, because the toolbar is before the button.

iOS 10

captura de pantalla 2017-12-01 a la s 20 15 55

iOS 11

captura de pantalla 2017-12-01 a la s 20 13 35

Material 2.12.17

Hey, sorry for the delay. I was on vacation. I will take a look today :)

I can confirm that is a bug.

Step to reproduce

  • Press on the menu button (in leftViews or RightViews) and swipe backward then the screen is stuck with dim background.

Material : 2.9.4
iOS 10.3.3, 11.1.2

@aemgtz Thank you. I am investigating the issue.

Here is my work around solution.
You have to subclass the NavigationDrawerController and override the receive touch delegate then add the condition to cancel touch event for specific view type.

`
import UIKit
import Material

class AppNavigationDrawer: NavigationDrawerController {

override func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
    if (touch.view?.isKind(of: IconButton.classForCoder()))!{
        print("Cancel touch when view is IconButton")
        return false
    }
    return super.gestureRecognizer(gestureRecognizer, shouldReceive: touch)
}

}

`

Can you try this commit and tell me if the issue has been fixed, 9d03ba4ebfebc1debe0f901098a9cbd3e881c453. Thank you!

I tried with Material 2.12.19.
This issue doesn't occur anymore.
Thank you!

@danieldahan Thank you! it's work for me too.
tell me please when you will make a release with this fix?

@ayham-achami nice, I will make a release now :)

Released in Material 2.12.19. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karstengresch picture karstengresch  路  15Comments

mohpor picture mohpor  路  43Comments

tbergeron picture tbergeron  路  19Comments

MacMeDan picture MacMeDan  路  28Comments

VNadygin picture VNadygin  路  18Comments