mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
mobile: fix screen jerks when opening add reminder screen from note
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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<Reminder["mode"]>(
|
||||
@@ -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
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user