From 57eafda6ef41f4c083b90ac520726ea3581149e4 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 9 Apr 2026 11:18:49 +0700 Subject: [PATCH] fix(app): fix BottomSheetTextInput crash on iPad model selector On iPad, Combobox uses the desktop Modal path (no BottomSheet context) since the breakpoint is "md"+, but ProviderSearchInput was checking Platform.OS === "web" to choose the input component. This caused BottomSheetTextInput to render outside a BottomSheet on iPad. Align the check with Combobox's own isMobile breakpoint logic. --- packages/app/src/components/combined-model-selector.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/combined-model-selector.tsx b/packages/app/src/components/combined-model-selector.tsx index ffb0ef6df..2c90b8425 100644 --- a/packages/app/src/components/combined-model-selector.tsx +++ b/packages/app/src/components/combined-model-selector.tsx @@ -9,7 +9,7 @@ import { type GestureResponderEvent, } from "react-native"; import { BottomSheetTextInput } from "@gorhom/bottom-sheet"; -import { StyleSheet, useUnistyles } from "react-native-unistyles"; +import { StyleSheet, UnistylesRuntime, useUnistyles } from "react-native-unistyles"; import { ArrowLeft, ChevronDown, @@ -348,7 +348,9 @@ function ProviderSearchInput({ }) { const { theme } = useUnistyles(); const inputRef = useRef(null); - const InputComponent = Platform.OS === "web" ? TextInput : BottomSheetTextInput; + const isMobile = + UnistylesRuntime.breakpoint === "xs" || UnistylesRuntime.breakpoint === "sm"; + const InputComponent = isMobile ? BottomSheetTextInput : TextInput; useEffect(() => { if (autoFocus && Platform.OS === "web" && inputRef.current) {