Search code examples
flutterextendspopupmenubutton

Flutter Override PopupMenuButton Widget to prevent soft keyboard to close


In my flutter mobile application, I use a PopupMenuButton placed at the bottom of the view. If I click on it, the soft keyboard is dismissed because the text input looses the focus I guess. So the popup menu does not show at the right place.

I would like to override this behavior to prevent PopupMenuButton to close the keyboard. Maybe by extending the PopupMenuButton class ? But I don't really know how to do it.

Keyboard open before click on button:

Menu not in the right place:


Solution

  • Seems to be the same issue as flutter/issues/24843 & flutter/issues/50567.

    A potential solution would be using the keep_keyboard_popup_menu package, which was uploaded a couple of days ago by PegasisForever.