From a081a77afc8bcb5ed753fde12e93986ebf2c4d08 Mon Sep 17 00:00:00 2001
From: mkzie2 <mkzie2@gmail.com>
Date: Thu, 4 Dec 2025 18:31:57 +0700
Subject: [PATCH 1/3] fix: duplicate action on expense report

---
 .../InvertedFlatList/BaseInvertedFlatList/index.tsx        | 1 +
 src/components/InvertedFlatList/index.native.tsx           | 5 ++++-
 src/components/InvertedFlatList/index.tsx                  | 5 ++++-
 src/pages/home/report/ReportActionsList.tsx                | 7 ++-----
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/components/InvertedFlatList/BaseInvertedFlatList/index.tsx b/src/components/InvertedFlatList/BaseInvertedFlatList/index.tsx
index 3a880b638fd2..62442db2063c 100644
--- a/src/components/InvertedFlatList/BaseInvertedFlatList/index.tsx
+++ b/src/components/InvertedFlatList/BaseInvertedFlatList/index.tsx
@@ -24,6 +24,7 @@ type BaseInvertedFlatListProps<T> = Omit<FlatListProps<T>, 'data' | 'renderItem'
     initialScrollKey?: string | null;
     ref?: ForwardedRef<RNFlatList>;
     shouldDisableVisibleContentPosition?: boolean;
+    shouldHideContent?: boolean;
 };
 
 function BaseInvertedFlatList<T>({ref, ...props}: BaseInvertedFlatListProps<T>) {
diff --git a/src/components/InvertedFlatList/index.native.tsx b/src/components/InvertedFlatList/index.native.tsx
index 50e6fb1d5cc1..bc265da89459 100644
--- a/src/components/InvertedFlatList/index.native.tsx
+++ b/src/components/InvertedFlatList/index.native.tsx
@@ -1,15 +1,18 @@
 import React from 'react';
+import useThemeStyles from '@hooks/useThemeStyles';
 import BaseInvertedFlatList from './BaseInvertedFlatList';
 import type {BaseInvertedFlatListProps} from './BaseInvertedFlatList';
 import CellRendererComponent from './CellRendererComponent';
 
-function BaseInvertedFlatListWithRef<T>({ref, ...props}: BaseInvertedFlatListProps<T>) {
+function BaseInvertedFlatListWithRef<T>({ref, shouldHideContent = false, ...props}: BaseInvertedFlatListProps<T>) {
+    const styles = useThemeStyles();
     return (
         <BaseInvertedFlatList
             // eslint-disable-next-line react/jsx-props-no-spreading
             {...props}
             ref={ref}
             CellRendererComponent={CellRendererComponent}
+            contentContainerStyle={[props.contentContainerStyle, shouldHideContent ? styles.opacity0 : styles.opacity1]}
             /**
              * To achieve absolute positioning and handle overflows for list items, the property must be disabled
              * for Android native builds.
diff --git a/src/components/InvertedFlatList/index.tsx b/src/components/InvertedFlatList/index.tsx
index 40b1451e1fed..7b4b0dab5132 100644
--- a/src/components/InvertedFlatList/index.tsx
+++ b/src/components/InvertedFlatList/index.tsx
@@ -1,6 +1,7 @@
 import React, {useEffect, useRef} from 'react';
 import type {NativeScrollEvent, NativeSyntheticEvent} from 'react-native';
 import {DeviceEventEmitter} from 'react-native';
+import useThemeStyles from '@hooks/useThemeStyles';
 import CONST from '@src/CONST';
 import BaseInvertedFlatList from './BaseInvertedFlatList';
 import type {BaseInvertedFlatListProps} from './BaseInvertedFlatList';
@@ -8,10 +9,11 @@ import CellRendererComponent from './CellRendererComponent';
 
 // This is adapted from https://codesandbox.io/s/react-native-dsyse
 // It's a HACK alert since FlatList has inverted scrolling on web
-function InvertedFlatList<T>({onScroll: onScrollProp = () => {}, ref, ...props}: BaseInvertedFlatListProps<T>) {
+function InvertedFlatList<T>({onScroll: onScrollProp = () => {}, shouldHideContent = false, ref, ...props}: BaseInvertedFlatListProps<T>) {
     const lastScrollEvent = useRef<number | null>(null);
     const scrollEndTimeout = useRef<NodeJS.Timeout | null>(null);
     const updateInProgress = useRef<boolean>(false);
+    const styles = useThemeStyles();
 
     useEffect(
         () => () => {
@@ -89,6 +91,7 @@ function InvertedFlatList<T>({onScroll: onScrollProp = () => {}, ref, ...props}:
             ref={ref}
             onScroll={handleScroll}
             CellRendererComponent={CellRendererComponent}
+            contentContainerStyle={[props.contentContainerStyle, shouldHideContent ? styles.visibilityHidden : styles.visibilityVisible]}
         />
     );
 }
diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx
index 6a910c1b4f3e..ebbdea9cc968 100644
--- a/src/pages/home/report/ReportActionsList.tsx
+++ b/src/pages/home/report/ReportActionsList.tsx
@@ -867,11 +867,8 @@ function ReportActionsList({
                     data={sortedVisibleReportActions}
                     renderItem={renderItem}
                     renderScrollComponent={renderActionSheetAwareScrollView}
-                    contentContainerStyle={[
-                        styles.chatContentScrollView,
-                        shouldScrollToEndAfterLayout ? styles.visibilityHidden : styles.visibilityVisible,
-                        shouldFocusToTopOnMount ? styles.justifyContentEnd : undefined,
-                    ]}
+                    contentContainerStyle={[styles.chatContentScrollView, shouldFocusToTopOnMount ? styles.justifyContentEnd : undefined]}
+                    shouldHideContent={shouldScrollToEndAfterLayout}
                     shouldDisableVisibleContentPosition={shouldScrollToEndAfterLayout}
                     showsVerticalScrollIndicator={!shouldScrollToEndAfterLayout}
                     keyExtractor={keyExtractor}

From 7b1501f224de9067a58acafc931c2ce76e343c11 Mon Sep 17 00:00:00 2001
From: mkzie2 <mkzie2@gmail.com>
Date: Mon, 15 Dec 2025 18:58:19 +0700
Subject: [PATCH 2/3] add comments

---
 src/components/FlatList/types.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/FlatList/types.ts b/src/components/FlatList/types.ts
index 9620d778fac1..50179c190d07 100644
--- a/src/components/FlatList/types.ts
+++ b/src/components/FlatList/types.ts
@@ -24,7 +24,7 @@ type CustomFlatListProps<T> = Omit<FlatListProps<T>, 'CellRendererComponent'> &
     CellRendererComponent?: React.ComponentType<CellRendererProps<T>> | null;
 
     /**
-     * Whether to hide the content
+     * Whether to hide the content when we need to (e.g. when first displaying the report actions list, we initial shows the top report actions first. We only show the full report actions list after user scrolls)
      */
     shouldHideContent?: boolean;
 };

From 337b75805ba78373000471fa7b88217f18f3875b Mon Sep 17 00:00:00 2001
From: mkzie2 <mkzie2@gmail.com>
Date: Tue, 23 Dec 2025 00:30:39 +0700
Subject: [PATCH 3/3] fix: update prop comment

---
 src/components/FlatList/types.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/FlatList/types.ts b/src/components/FlatList/types.ts
index 50179c190d07..b6ddf4096302 100644
--- a/src/components/FlatList/types.ts
+++ b/src/components/FlatList/types.ts
@@ -24,7 +24,7 @@ type CustomFlatListProps<T> = Omit<FlatListProps<T>, 'CellRendererComponent'> &
     CellRendererComponent?: React.ComponentType<CellRendererProps<T>> | null;
 
     /**
-     * Whether to hide the content when we need to (e.g. when first displaying the report actions list, we initial shows the top report actions first. We only show the full report actions list after user scrolls)
+     * Whether to hide the content (e.g. when first displaying the report actions list, we initially show only the top report actions. We then show the full report actions list after the user scrolls)
      */
     shouldHideContent?: boolean;
 };
