I have read the guidelines for contributing and I understand:
Steps to reproduce bug in demo project:
-click on TextView (keyboard appears)
-click on button (sideMenu appears)
Result:
-keyboard hides and appears again on side menu
Wanted result:
No keyboard at all when side menu is visible
I have a UITextView in mainVC, when textview has focus and keyboard is visible when I open sideMenuVC keyboard disappears and appears again. I don't have any textfield or any need for keyboard in sideMenu at all, how can I stop this behaviour?
It should work like this:
I'm in mainVC with keyboard visible and textview in focus, I open side menu - keyboard disappears. I hide side menu - keyboard appears again.
As mentioned here when opening sideMenuVC viewDidAppear of mainVC is being called. I can call view.endEditing(true) here, but I need to know here that call of this function has been caused by opening sideMenu, because of course I don't want to hide keyboard every time my mainVC with textview appears.
@szooky unfortunately I don't have a solution to this. If you can investigate further and find one, that would be a massive help.
I've tried dismissing the keyboard in various places of the code but they all yield the same result. This appears to be a strange behavior related to using custom transitions; there should probably be an Apple radar open if there isn't one as there is nothing obvious that this library is doing wrong.
You can try dismissing the keyboard before you present SideMenu and see if that helps.
Unfortunately, dismissing the keyboard before presenting SideMenu doesn't help. The keyboard still pops up as before...
It looks like there is a difference between dismissing the keyboard manually and programmatically.
@pilniks I mean completely dismissing it, not dismissing it and having it animate away while presenting SideMenu.
What's the difference?
Hacky hack... works for me.
class mainVC: UIViewController {
... mainVC code
@IBAction func showMenuButtonTapped(_ sender: Any) {
self.view.endEditing(true)
// ... present sideMenu...
}
... mainVC code
}
This issue should now be resolved in version 6.0.0+ of SideMenu. Please run pod update and reopen this issue if the problem persists.
Most helpful comment
Hacky hack... works for me.