From 07db14f6bf9889333243f4cde59a0ab8fdf69e6b Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Mon, 1 Jun 2026 11:53:00 +0500 Subject: [PATCH] mobile: fix screen jerks when opening add reminder screen from note --- apps/mobile/app/hooks/use-actions.tsx | 3 ++- apps/mobile/app/screens/add-reminder/index.tsx | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/mobile/app/hooks/use-actions.tsx b/apps/mobile/app/hooks/use-actions.tsx index 74fc1daf9..8d169d13f 100644 --- a/apps/mobile/app/hooks/use-actions.tsx +++ b/apps/mobile/app/hooks/use-actions.tsx @@ -1128,8 +1128,9 @@ export const useActions = ({ id: "add-reminder", title: strings.remindMe(), icon: "clock-plus-outline", - onPress: () => { + onPress: async () => { close(); + await sleep(100); AddReminder.present(undefined, item); } }, diff --git a/apps/mobile/app/screens/add-reminder/index.tsx b/apps/mobile/app/screens/add-reminder/index.tsx index 989c1d781..4ab3c81f5 100644 --- a/apps/mobile/app/screens/add-reminder/index.tsx +++ b/apps/mobile/app/screens/add-reminder/index.tsx @@ -95,7 +95,17 @@ const ReminderNotificationModes = { export default function AddReminder(props: NavigationProps<"AddReminder">) { const { reminder, reference } = props.route.params; - useNavigationFocus(props.navigation, { focusOnInit: true }); + useNavigationFocus(props.navigation, { + focusOnInit: true, + onFocus: () => { + if (!props.route.params?.reminder) { + setTimeout(() => { + titleRef.current?.focus(); + }, 200); + } + return false; + } + }); const { colors, isDark } = useThemeColors(); const weekFormat = useSettingStore((state) => state.weekFormat); const [reminderMode, setReminderMode] = useState( @@ -282,7 +292,6 @@ export default function AddReminder(props: NavigationProps<"AddReminder">) { defaultValue={reminder?.title || referencedItem?.title} placeholder={strings.remindeMeOf()} onChangeText={(text) => (title.current = text)} - autoFocus wrapperStyle={{ marginTop: DefaultAppStyles.GAP_VERTICAL }}