From 9a3e78a7f81035c25ed2676aea521105c40a2755 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 12 Aug 2024 03:53:10 +0300 Subject: [PATCH 1/2] Fix back navigation focus in task creation --- src/components/FormAlertWithSubmitButton.tsx | 6 ++++++ src/pages/tasks/NewTaskPage.tsx | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/FormAlertWithSubmitButton.tsx b/src/components/FormAlertWithSubmitButton.tsx index e9b7b27f1475..5f0b3ab8b3a6 100644 --- a/src/components/FormAlertWithSubmitButton.tsx +++ b/src/components/FormAlertWithSubmitButton.tsx @@ -1,3 +1,4 @@ +import type {Ref} from 'react'; import React from 'react'; import type {StyleProp, ViewStyle} from 'react-native'; import {View} from 'react-native'; @@ -46,6 +47,9 @@ type FormAlertWithSubmitButtonProps = { /** Whether to show the alert text */ isAlertVisible?: boolean; + /** React ref being forwarded to the submit button */ + buttonRef?: Ref; + /** Text for the button */ buttonText: string; @@ -70,6 +74,7 @@ function FormAlertWithSubmitButton({ disablePressOnEnter = false, isSubmitActionDangerous = false, footerContent, + buttonRef, buttonStyles, buttonText, isAlertVisible = false, @@ -105,6 +110,7 @@ function FormAlertWithSubmitButton({ /> ) : (