Skip to content

fix(ios): keep the keyboard inset in the typing scene - #1168

Merged
houko merged 1 commit into
nsgo-dev:mainfrom
houko:fix/ios-scene-keyboard-1160
Nov 21, 2026
Merged

houko merged 1 commit into
nsgo-dev:mainfrom
houko:fix/ios-scene-keyboard-1160

Conversation

@houko

@houko houko commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ship the keyboard inset only to the iPad scene receiving input, and clear it when that scene loses the keyboard or disconnects. UIKit can mark a window as key in each scene, including a background scene. The backend uses the foreground-active scene, and asks UIKit to route an action through the current responder chain when there is more than one active scene.

Closes #1160.

Targets

  • iOS

Screenshots

None.

Verification

  • go tool nsgo check -target ios,tvos -jobs 2 ./internal/platform/ios
  • Five native scene tests passed on an iPad Pro simulator running iPadOS 27.2. The keyboard test focuses the second scene, then the first, then the second again. Before the fix, both scenes reported an inset of 403 points. With the fix, only the focused scene reported an inset at each step.
  • The tested simulator presented each scene in the foreground in turn. Simultaneous side-by-side presentation was not verified.

Checklist

  • Conventional Commit title
  • Architecture documentation and Unreleased changelog updated
  • No new third-party dependencies

@github-actions github-actions Bot added bug Something isn't working size/M documentation Improvements or additions to documentation iOS ci labels Nov 21, 2026
@houko

houko commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed.

  • keyboardMoved now applies the keyboard's height only to the window receiving input: the only scene that is foreground-active, or when several are, the window a nil-targeted nsgoKeyboardWindow: action reaches through the responder chain (the window class is now NsgoWindow, which answers it). Every other scene gets 0, and a disconnecting scene clears its inset. Embedded views and single-scene apps keep the old path. That matches iOS multi-scene: every scene takes the keyboard inset, not only the one being typed in #1160.
  • TestSceneKeyboardInsetFollowsFocus is added to the iPad scene tests the apple-simulator job runs. The author saw both scenes report 403 points before the fix and only the focused one after.
  • The first apple run failed in TestSelectMovesTheNativeSelection on macOS ("the macOS test app is not active"), which is the runner's focus state and not this iOS-only change. It passed on a rerun.

@houko
houko merged commit f7fc2f5 into nsgo-dev:main Nov 21, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci documentation Improvements or additions to documentation iOS size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS multi-scene: every scene takes the keyboard inset, not only the one being typed in

1 participant