diff --git a/components/search/TVSearchPage.tsx b/components/search/TVSearchPage.tsx index 580e8a002..24e6120d1 100644 --- a/components/search/TVSearchPage.tsx +++ b/components/search/TVSearchPage.tsx @@ -2,7 +2,7 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { useAtom } from "jotai"; import { useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { ScrollView, View } from "react-native"; +import { Platform, ScrollView, TextInput, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Text } from "@/components/common/Text"; import { TVDiscover } from "@/components/jellyseerr/discover/TVDiscover"; @@ -231,26 +231,48 @@ export const TVSearchPage: React.FC = ({ paddingTop: insets.top + TOP_PADDING, }} > - {/* Native tvOS search field (SwiftUI `.searchable`, our `tv-search` - module). It renders the native search bar + grid keyboard and - forwards typed text into the existing query pipeline via setSearch; - our own results grid renders below. */} - {/* No horizontal margin here: the native tvOS search bar centers itself - and renders a trailing "Hold to Dictate in " hint. Extra - margins squeeze the bar's width and clip that trailing hint, so let - the native view span the full width and own its own insets. */} - - setSearch(e.nativeEvent.text)} - /> - + {/* Search bar: native tvOS SwiftUI `.searchable` on Apple TV, standard + TextInput fallback on Android TV (the native module is Apple-only). */} + {Platform.OS === "ios" ? ( + + {/* No horizontal margin here: the native tvOS search bar centers + itself and renders a trailing "Hold to Dictate" hint. */} + setSearch(e.nativeEvent.text)} + /> + + ) : ( + + + + )} -> = requireNativeView("TvSearchModule"); +> = + Platform.OS === "ios" + ? requireNativeView("TvSearchModule") + : ((() => null) as any); /** * Forwards its ref to the underlying native view so it can be used as a