diff --git a/src/pages/EditReportFieldDropdownPage.tsx b/src/pages/EditReportFieldDropdownPage.tsx index a3d9c2fd99ff..3bd227c5dcf1 100644 --- a/src/pages/EditReportFieldDropdownPage.tsx +++ b/src/pages/EditReportFieldDropdownPage.tsx @@ -89,7 +89,7 @@ function EditReportFieldDropdownPage({fieldName, onSubmit, fieldKey, fieldValue, }); } - const filteredRecentlyUsedOptions = recentlyUsedOptions.filter((option) => option !== selectedValue); + const filteredRecentlyUsedOptions = recentlyUsedOptions.filter((option) => option !== selectedValue && fieldOptions.includes(option)); if (filteredRecentlyUsedOptions.length > 0) { newSections.push({ title: translate('common.recents'), diff --git a/src/pages/EditReportFieldPage.tsx b/src/pages/EditReportFieldPage.tsx index 8c8376468c0f..72a472db3da0 100644 --- a/src/pages/EditReportFieldPage.tsx +++ b/src/pages/EditReportFieldPage.tsx @@ -106,7 +106,7 @@ function EditReportFieldPage({route, policy, report}: EditReportFieldPageProps) fieldKey={fieldKey} fieldName={Str.UCFirst(reportField.name)} fieldValue={fieldValue} - fieldOptions={reportField.values.filter((value) => !(value in reportField.disabledOptions))} + fieldOptions={reportField.values.filter((_value: string, index: number) => !reportField.disabledOptions[index])} onSubmit={handleReportFieldChange} /> );