From 873dcb8659a2bd47cd2feac26bc2bfab17ae9b87 Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 12 Jun 2024 17:09:11 +0700 Subject: [PATCH 1/2] fix Invisible send button above keyboard --- src/components/AttachmentModal.tsx | 26 ++------------------------ src/components/PDFView/index.tsx | 1 - 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/components/AttachmentModal.tsx b/src/components/AttachmentModal.tsx index 54a073e30567..b2f2cdfeeecf 100644 --- a/src/components/AttachmentModal.tsx +++ b/src/components/AttachmentModal.tsx @@ -359,28 +359,6 @@ function AttachmentModal({ [isValidFile, getModalType, isDirectoryCheck], ); - /** - * In order to gracefully hide/show the confirm button when the keyboard - * opens/closes, apply an animation to fade the confirm button out/in. And since - * we're only updating the opacity of the confirm button, we must also conditionally - * disable it. - * - * @param shouldFadeOut If true, fade out confirm button. Otherwise fade in. - */ - const updateConfirmButtonVisibility = useCallback( - (shouldFadeOut: boolean) => { - setIsConfirmButtonDisabled(shouldFadeOut); - const toValue = shouldFadeOut ? 0 : 1; - - Animated.timing(confirmButtonFadeAnimation, { - toValue, - duration: 100, - useNativeDriver, - }).start(); - }, - [confirmButtonFadeAnimation], - ); - /** * close the modal */ @@ -547,7 +525,7 @@ function AttachmentModal({ source={sourceForAttachmentView} isAuthTokenRequired={isAuthTokenRequiredState} file={file} - onToggleKeyboard={updateConfirmButtonVisibility} + onToggleKeyboard={setIsConfirmButtonDisabled} isWorkspaceAvatar={isWorkspaceAvatar} maybeIcon={maybeIcon} fallbackSource={fallbackSource} @@ -559,7 +537,7 @@ function AttachmentModal({ ))} {/* If we have an onConfirm method show a confirmation button */} - {!!onConfirm && ( + {!!onConfirm && !isConfirmButtonDisabled && ( {({safeAreaPaddingBottomStyle}) => ( diff --git a/src/components/PDFView/index.tsx b/src/components/PDFView/index.tsx index c7169870b4b8..a64a676cb97a 100644 --- a/src/components/PDFView/index.tsx +++ b/src/components/PDFView/index.tsx @@ -120,7 +120,6 @@ function PDFView({onToggleKeyboard, fileName, onPress, isFocused, sourceURL, max isPasswordInvalid={isPasswordInvalid} onSubmit={onSubmit} onPasswordUpdated={onPasswordChange} - onPasswordFieldFocused={toggleKeyboardOnSmallScreens} /> )} /> From de626eef28ca732368961f199e2f37d68654ef9a Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 12 Jun 2024 17:28:50 +0700 Subject: [PATCH 2/2] fix lint --- src/components/AttachmentModal.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/AttachmentModal.tsx b/src/components/AttachmentModal.tsx index b2f2cdfeeecf..a1c5e1b949ed 100644 --- a/src/components/AttachmentModal.tsx +++ b/src/components/AttachmentModal.tsx @@ -18,7 +18,6 @@ import * as FileUtils from '@libs/fileDownload/FileUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; -import useNativeDriver from '@libs/useNativeDriver'; import type {AvatarSource} from '@libs/UserUtils'; import variables from '@styles/variables'; import * as IOU from '@userActions/IOU';