Skip to content

TextField in popup cannot receive keyboard focus when using PopupSceneDelegate #201

@videni

Description

@videni

Problem

When using PopupSceneDelegate, TextField inside popups cannot receive keyboard focus. The keyboard does not appear when the popup is presented.

Root Cause

When the user clicks a button to present a popup:

  1. The click occurs on the main app window
  2. iOS automatically makes the main window the key window
  3. The popup is displayed in the popup window (created by PopupSceneDelegate)
  4. Since the popup window is not the key window, TextField inside it cannot receive keyboard focus

Expected Behavior

TextField inside popups should be able to receive keyboard focus and show the keyboard automatically.

Proposed Solution

  1. Rename the internal Window class to MijickWindow for reliable identification
  2. After presenting a popup, find the MijickWindow by class name and call makeKey() to make it the key window

No need to restore the previous key window when the popup is dismissed, because iOS will automatically make the main window the key window when the user interacts with it.

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