From 9c8f1f4d881762023bf3df075363ffa42f8d6808 Mon Sep 17 00:00:00 2001 From: 289Adam289 Date: Tue, 25 Mar 2025 14:16:16 +0100 Subject: [PATCH 1/2] Add dismiss keyboard on press --- src/pages/Share/ShareDetailsPage.tsx | 150 +++++++++++++++------------ 1 file changed, 82 insertions(+), 68 deletions(-) diff --git a/src/pages/Share/ShareDetailsPage.tsx b/src/pages/Share/ShareDetailsPage.tsx index 03ed527d5d58..620b98bab927 100644 --- a/src/pages/Share/ShareDetailsPage.tsx +++ b/src/pages/Share/ShareDetailsPage.tsx @@ -6,8 +6,10 @@ import type {OnyxEntry} from 'react-native-onyx'; import AttachmentModal from '@components/AttachmentModal'; import AttachmentPreview from '@components/AttachmentPreview'; import Button from '@components/Button'; +import FixedFooter from '@components/FixedFooter'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import {FallbackAvatar} from '@components/Icon/Expensicons'; +import {PressableWithoutFeedback} from '@components/Pressable'; import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; import Text from '@components/Text'; @@ -28,6 +30,7 @@ import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; import type {Report as ReportType} from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; +import KeyboardUtils from '@src/utils/keyboard'; import {showErrorAlert} from './ShareRootPage'; type ShareDetailsPageProps = StackScreenProps; @@ -46,6 +49,7 @@ function ShareDetailsPage({ const report: OnyxEntry = getReportOrDraftReport(reportOrAccountID); const displayReport = useMemo(() => getReportDisplayOption(report, unknownUserDetails), [report, unknownUserDetails]); + if (isEmptyObject(report)) { return ; } @@ -96,85 +100,95 @@ function ShareDetailsPage({ }; return ( - { + KeyboardUtils.dismiss(); + }} + accessible={false} > - - - {!!report && ( - <> - - {translate('common.to')} - - {}} - pressableStyle={[styles.flexRow]} - shouldSyncFocus={false} - isDisabled - /> - - )} + + + - - - - - - - {shouldShowAttachment && ( - <> - - {translate('common.attachment')} + {!!report && ( + + + {translate('common.to')} - - - {({show}) => ( - { - showErrorAlert(translate('attachmentPicker.attachmentError'), translate('attachmentPicker.errorWhileSelectingCorruptedAttachment')); - }} - /> - )} - - - + { + KeyboardUtils.dismiss(); + }} + pressableStyle={[styles.flexRow]} + shouldSyncFocus={false} + /> + )} - - + + + + + + + {shouldShowAttachment && ( + <> + + {translate('common.attachment')} + + + + {({show}) => ( + { + showErrorAlert(translate('attachmentPicker.attachmentError'), translate('attachmentPicker.errorWhileSelectingCorruptedAttachment')); + }} + /> + )} + + + + )} + + +