Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationDrawerController and menu button #977

Closed
ayham-achami opened this issue Nov 20, 2017 · 26 comments
Closed

NavigationDrawerController and menu button #977

ayham-achami opened this issue Nov 20, 2017 · 26 comments

Comments

@ayham-achami
Copy link

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

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Nov 20, 2017

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!

@ayham-achami
Copy link
Author

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

@daniel-jonathan
Copy link
Member

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

@ayham-achami
Copy link
Author

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

nov-20-2017 17-38-10

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Nov 20, 2017

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?

@ayham-achami
Copy link
Author

you swipe to left when tap on left UIBarButtonItem ?

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Nov 20, 2017

Here is what I get:

navdrawer

@daniel-jonathan
Copy link
Member

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

@ayham-achami
Copy link
Author

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.

@daniel-jonathan
Copy link
Member

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 :)

@ayham-achami
Copy link
Author

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.

@daniel-jonathan
Copy link
Member

Thank you, I will take a look :)

@daniel-jonathan
Copy link
Member

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

@toonvanstrijp
Copy link

toonvanstrijp commented Nov 23, 2017

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

@daniel-jonathan
Copy link
Member

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

@muzoman
Copy link

muzoman commented Dec 1, 2017

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

@Spr-Luis
Copy link

Spr-Luis commented Dec 2, 2017

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

@daniel-jonathan
Copy link
Member

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

@aemgtz
Copy link

aemgtz commented Dec 6, 2017

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

@daniel-jonathan
Copy link
Member

@aemgtz Thank you. I am investigating the issue.

@aemgtz
Copy link

aemgtz commented Dec 7, 2017

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)
}

}

`

@daniel-jonathan
Copy link
Member

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

@aemgtz
Copy link

aemgtz commented Dec 7, 2017

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

@ayham-achami
Copy link
Author

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

@daniel-jonathan
Copy link
Member

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

@daniel-jonathan
Copy link
Member

Released in Material 2.12.19. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants