Skip to content

# Context Menu Appears Behind Keyboard on Android Devices #551

@ismailgzn

Description

@ismailgzn

Context Menu Appears Behind Keyboard on Android Devices

Description

When using ContextMenuWidget on Android devices, the context menu appears behind the on-screen keyboard when it's open, making the menu items inaccessible to users. This creates a poor user experience as users cannot interact with the context menu options.

Steps to Reproduce

  1. Open a Flutter app with a text input field on an Android device
  2. Tap on the text field to open the keyboard
  3. Long press on a ContextMenuWidget to trigger the context menu
  4. Observe that the context menu appears behind the keyboard, making it inaccessible

Expected Behavior

The context menu should:

  • Appear above the keyboard when it's open
  • Automatically adjust its position to remain visible
  • Be fully accessible to users regardless of keyboard state
    -After the closing context menu should be reopening the keyboard

Current Behavior

  • Context menu appears behind the keyboard
  • Menu items are not accessible when keyboard is open
  • Users must dismiss the keyboard to access context menu options

Environment

  • Package Version: super_context_menu: ^0.9.1
  • Flutter Version: 3.24.0 (or latest)
  • Platform: Android
  • Android Version: Tested on Android 12+ (API level 31+)
  • Device Models: Various Android devices

Code Example

ContextMenuWidget(
  menuProvider: (context) => Menu(
    children: [
      MenuAction(
        title: 'Copy',
        callback: () {
          // Action
        },
      ),
      MenuAction(
        title: 'Share',
        callback: () {
          // Action
        },
      ),
    ],
  ),
  child: Container(
    // Your widget content
  ),
)

Related Issues

This issue is similar to other Flutter context menu problems reported in:

Additional Context

  • This issue specifically affects Android devices
  • iOS devices don't seem to have this problem
  • The issue occurs with both ContextMenuWidget and other context menu implementations
  • This is a common UX problem in mobile apps that needs to be addressed at the package level

Workaround

Currently, developers need to implement custom keyboard detection and positioning logic, which adds complexity and maintenance overhead to their applications.


Priority: High (affects core functionality and user experience)
Labels: bug, android, keyboard, ux, context-menu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions