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:
- The click occurs on the main app window
- iOS automatically makes the main window the key window
- The popup is displayed in the popup window (created by
PopupSceneDelegate)
- 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
- Rename the internal
Window class to MijickWindow for reliable identification
- 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.
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:
PopupSceneDelegate)Expected Behavior
TextField inside popups should be able to receive keyboard focus and show the keyboard automatically.
Proposed Solution
Windowclass toMijickWindowfor reliable identificationMijickWindowby class name and callmakeKey()to make it the key windowNo 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.