fix(ios): drop NativeWind ring-* from Input focus state (crashed on native)#112
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found via iOS Simulator testing
Focusing any
Inputon 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)
<TextInput autoFocus>focuses cleanly.<Input>does not — on focus it togglesisFocused, which addsborder-ring ring-1 ring-ring.ring-1 ring-ring(keepingborder-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 blueborder-ringis a clear focus indicator and works on both web and native.Inputwas the onlyring-*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