From 7a9bc04c760d456a5cb76d76a538e6bd3a577d7d Mon Sep 17 00:00:00 2001 From: truph01 Date: Wed, 14 May 2025 16:44:42 +0700 Subject: [PATCH 1/2] fix: Category lists below is blank when deselecting it --- src/pages/iou/request/step/IOURequestStepCategory.tsx | 1 + src/pages/iou/request/step/StepScreenWrapper.tsx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/pages/iou/request/step/IOURequestStepCategory.tsx b/src/pages/iou/request/step/IOURequestStepCategory.tsx index fb56c3e422b6..cfa2cb675b3b 100644 --- a/src/pages/iou/request/step/IOURequestStepCategory.tsx +++ b/src/pages/iou/request/step/IOURequestStepCategory.tsx @@ -148,6 +148,7 @@ function IOURequestStepCategory({ shouldShowNotFoundPage={shouldShowNotFoundPage} shouldShowOfflineIndicator={policyCategories !== undefined} testID={IOURequestStepCategory.displayName} + shouldEnableKeyboardAvoidingView={false} > {isLoading && ( ; + + /** Flag to indicate if the keyboard avoiding view should be enabled */ + shouldEnableKeyboardAvoidingView?: boolean; }; function StepScreenWrapper({ @@ -48,6 +51,7 @@ function StepScreenWrapper({ shouldShowNotFoundPage, includeSafeAreaPaddingBottom, shouldShowOfflineIndicator = true, + shouldEnableKeyboardAvoidingView = true, }: StepScreenWrapperProps) { const styles = useThemeStyles(); @@ -62,6 +66,7 @@ function StepScreenWrapper({ testID={testID} shouldEnableMaxHeight={DeviceCapabilities.canUseTouchScreen()} shouldShowOfflineIndicator={shouldShowOfflineIndicator} + shouldEnableKeyboardAvoidingView={shouldEnableKeyboardAvoidingView} > {({insets, safeAreaPaddingBottomStyle, didScreenTransitionEnd}) => ( From eb2dbe62eb16babeaa25491e67c8111ea3cbb041 Mon Sep 17 00:00:00 2001 From: truph01 Date: Wed, 14 May 2025 17:19:28 +0700 Subject: [PATCH 2/2] fix: lint --- .../iou/request/step/IOURequestStepCategory.tsx | 16 ++++++++-------- src/pages/iou/request/step/StepScreenWrapper.tsx | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepCategory.tsx b/src/pages/iou/request/step/IOURequestStepCategory.tsx index cfa2cb675b3b..5cac8b3899f6 100644 --- a/src/pages/iou/request/step/IOURequestStepCategory.tsx +++ b/src/pages/iou/request/step/IOURequestStepCategory.tsx @@ -44,12 +44,12 @@ function IOURequestStepCategory({ }, transaction, }: IOURequestStepCategoryProps) { - const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getIOURequestPolicyID(transaction, reportReal)}`); - const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${getIOURequestPolicyID(transaction, reportDraft)}`); - const [splitDraftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`); - const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getIOURequestPolicyID(transaction, reportReal)}`); - const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${getIOURequestPolicyID(transaction, reportDraft)}`); - const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getIOURequestPolicyID(transaction, reportReal)}`); + const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getIOURequestPolicyID(transaction, reportReal)}`, {canBeMissing: true}); + const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${getIOURequestPolicyID(transaction, reportDraft)}`, {canBeMissing: true}); + const [splitDraftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`, {canBeMissing: true}); + const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${getIOURequestPolicyID(transaction, reportReal)}`, {canBeMissing: true}); + const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${getIOURequestPolicyID(transaction, reportDraft)}`, {canBeMissing: true}); + const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getIOURequestPolicyID(transaction, reportReal)}`, {canBeMissing: true}); let reportID = '-1'; if (action === CONST.IOU.ACTION.EDIT && reportReal) { if (iouType === CONST.IOU.TYPE.SPLIT) { @@ -58,8 +58,8 @@ function IOURequestStepCategory({ reportID = reportReal.parentReportID; } } - const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {canEvict: false}); - const [session] = useOnyx(ONYXKEYS.SESSION); + const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {canEvict: false, canBeMissing: true}); + const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true}); const report = reportReal ?? reportDraft; const policy = policyReal ?? policyDraft; diff --git a/src/pages/iou/request/step/StepScreenWrapper.tsx b/src/pages/iou/request/step/StepScreenWrapper.tsx index da0fb370b857..53b2d85c3c00 100644 --- a/src/pages/iou/request/step/StepScreenWrapper.tsx +++ b/src/pages/iou/request/step/StepScreenWrapper.tsx @@ -6,7 +6,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; import type {ScreenWrapperChildrenProps} from '@components/ScreenWrapper'; import ScreenWrapper from '@components/ScreenWrapper'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as DeviceCapabilities from '@libs/DeviceCapabilities'; +import {canUseTouchScreen} from '@libs/DeviceCapabilities'; import callOrReturn from '@src/types/utils/callOrReturn'; type StepScreenWrapperProps = { @@ -64,7 +64,7 @@ function StepScreenWrapper({ includeSafeAreaPaddingBottom={includeSafeAreaPaddingBottom} onEntryTransitionEnd={onEntryTransitionEnd} testID={testID} - shouldEnableMaxHeight={DeviceCapabilities.canUseTouchScreen()} + shouldEnableMaxHeight={canUseTouchScreen()} shouldShowOfflineIndicator={shouldShowOfflineIndicator} shouldEnableKeyboardAvoidingView={shouldEnableKeyboardAvoidingView} >