diff --git a/components/common/HeaderBackButton.tsx b/components/common/HeaderBackButton.tsx index 8818a9a09..cbb10cb38 100644 --- a/components/common/HeaderBackButton.tsx +++ b/components/common/HeaderBackButton.tsx @@ -1,6 +1,6 @@ import { Ionicons } from "@expo/vector-icons"; import { BlurView, type BlurViewProps } from "expo-blur"; -import { Platform } from "react-native"; +import { Keyboard, Platform } from "react-native"; import { Pressable, type PressableProps } from "react-native-gesture-handler"; import useRouter from "@/hooks/useAppRouter"; @@ -16,10 +16,17 @@ export const HeaderBackButton: React.FC = ({ }) => { const router = useRouter(); + // Dismiss the keyboard before navigating — otherwise it lingers over the + // previous screen (e.g. leaving the Jellyseerr login while typing). + const handleBack = () => { + Keyboard.dismiss(); + router.back(); + }; + if (Platform.OS === "ios") { return ( router.back()} + onPress={handleBack} className='flex items-center justify-center w-9 h-9' {...pressableProps} > @@ -30,7 +37,7 @@ export const HeaderBackButton: React.FC = ({ if (background === "transparent" && Platform.OS !== "android") return ( - router.back()} {...pressableProps}> + = ({ return ( router.back()} + onPress={handleBack} className=' rounded-full p-2' {...pressableProps} >