Sidemenu: Keyboard hides and opens again when sideMenu appears, it shouldn't appear at all

Created on 17 Apr 2018  路  5Comments  路  Source: jonkykong/SideMenu

New Issue Checklist


I have read the guidelines for contributing and I understand:

  • [x] My issue is happening in the latest version of SideMenu.
  • [x] My issue was not solved in the README.
  • [x] My issue can not be answered on stackoverflow.com.
  • [x] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
  • [x] My issue is reproducible in the demo project.

Issue Description

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.

Bug - Help Wanted! Low Priority

Most helpful comment

Hacky hack... works for me.

class mainVC: UIViewController {
... mainVC code
  @IBAction func showMenuButtonTapped(_ sender: Any) {
    self.view.endEditing(true)

    // ... present sideMenu...
  }
... mainVC code
}

All 5 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szooky picture szooky  路  3Comments

vkolosovsky picture vkolosovsky  路  4Comments

CaliCastle picture CaliCastle  路  3Comments

aco314 picture aco314  路  6Comments

harshvishu picture harshvishu  路  3Comments