Skip to content

fix(ios): drop NativeWind ring-* from Input focus state (crashed on native)#112

Merged
os-zhuang merged 1 commit into
mainfrom
fix/ios-input-focus-ring
Jun 11, 2026
Merged

fix(ios): drop NativeWind ring-* from Input focus state (crashed on native)#112
os-zhuang merged 1 commit into
mainfrom
fix/ios-input-focus-ring

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Found via iOS Simulator testing

Focusing any Input on iOS threw "Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'?" and blanked the screen — blocking the Connect and Sign-In screens (and every text field) on device. It never reproduced on web.

Root cause (bisected on iPhone 17)

  • A bare <TextInput autoFocus> focuses cleanly.
  • Our <Input> does not — on focus it toggles isFocused, which adds border-ring ring-1 ring-ring.
  • Removing just ring-1 ring-ring (keeping border-ring) → clean focus, no error.

So NativeWind's ring-* utilities blow up when applied on native iOS; the thrown error is mis-reported as a navigation-context failure (misleading message, real trigger is the ring class).

Fix

One line: isFocused && "border-ring ring-1 ring-ring"isFocused && "border-ring". The blue border-ring is a clear focus indicator and works on both web and native. Input was the only ring-* usage in the app.

Verified end-to-end on device

After the fix, drove the full flow on the iPhone 17 simulator with no redbox: Connect → entered server URL → Sign In → entered credentials → Dashboard (Total Tasks 8, real metrics, colored pie chart — the P0 dashboard fix confirmed on native too). The Input snapshot test still passes (it captures the unfocused state).

🤖 Generated with Claude Code

…ative)

Focusing any `Input` on iOS threw "Couldn't find a navigation context" and
blanked the screen. Bisected on the iPhone 17 simulator: a bare `TextInput`
focuses fine, but our `Input` does not — the difference is the focus state
toggling the `ring-1 ring-ring` NativeWind utilities. Those ring utilities blow
up when applied on native iOS (the error is mis-reported as a navigation-context
failure). `border-ring` alone gives a clear focus indicator (blue border) and
works cleanly.

This blocked the Connect / Sign-In screens — and every text field — on iOS.
Found and fixed via Simulator testing; verified the full flow end-to-end on
device (Connect → Sign In → Dashboard) with no redbox after the change. The
Input snapshot test still passes (it captures the unfocused state).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@os-zhuang os-zhuang merged commit 60d5d59 into main Jun 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant