diff --git a/src/CONST.ts b/src/CONST.ts index 0b10e5767328..b4a88b774998 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -3132,6 +3132,7 @@ const CONST = { }, MINI_CONTEXT_MENU_MAX_ITEMS: 4, + REPORT_FIELD_TITLE_FIELD_ID: 'text_title', } as const; export default CONST; diff --git a/src/components/ReportActionItem/MoneyReportView.tsx b/src/components/ReportActionItem/MoneyReportView.tsx index 4fcca3e518a5..68b725c3458e 100644 --- a/src/components/ReportActionItem/MoneyReportView.tsx +++ b/src/components/ReportActionItem/MoneyReportView.tsx @@ -75,7 +75,7 @@ function MoneyReportView({report, policyReportFields, shouldShowHorizontalRule}: title={title} onPress={() => {}} shouldShowRightIcon - disabled={false} + disabled={ReportUtils.isReportFieldOfTypeTitle(reportField)} wrapperStyle={[styles.pv2, styles.taskDescriptionMenuItem]} shouldGreyOutWhenDisabled={false} numberOfLinesTitle={0} diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 8e78dead4a93..8d95de2d7d12 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4523,6 +4523,13 @@ function getReportFieldTitle(report: OnyxEntry, reportField: PolicyRepor }); } +/** + * Given a report field, check if the field is for the report title. + */ +function isReportFieldOfTypeTitle(reportField: PolicyReportField): boolean { + return reportField.type === 'formula' && reportField.fieldID === CONST.REPORT_FIELD_TITLE_FIELD_ID; +} + /** * Checks if thread replies should be displayed */ @@ -4738,6 +4745,7 @@ export { shouldDisableThread, doesReportBelongToWorkspace, getChildReportNotificationPreference, + isReportFieldOfTypeTitle, }; export type {