From a081a77afc8bcb5ed753fde12e93986ebf2c4d08 Mon Sep 17 00:00:00 2001 From: mkzie2 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 = Omit, 'data' | 'renderItem' initialScrollKey?: string | null; ref?: ForwardedRef; shouldDisableVisibleContentPosition?: boolean; + shouldHideContent?: boolean; }; function BaseInvertedFlatList({ref, ...props}: BaseInvertedFlatListProps) { 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({ref, ...props}: BaseInvertedFlatListProps) { +function BaseInvertedFlatListWithRef({ref, shouldHideContent = false, ...props}: BaseInvertedFlatListProps) { + const styles = useThemeStyles(); return ( ({onScroll: onScrollProp = () => {}, ref, ...props}: BaseInvertedFlatListProps) { +function InvertedFlatList({onScroll: onScrollProp = () => {}, shouldHideContent = false, ref, ...props}: BaseInvertedFlatListProps) { const lastScrollEvent = useRef(null); const scrollEndTimeout = useRef(null); const updateInProgress = useRef(false); + const styles = useThemeStyles(); useEffect( () => () => { @@ -89,6 +91,7 @@ function InvertedFlatList({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 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 = Omit, 'CellRendererComponent'> & CellRendererComponent?: React.ComponentType> | 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 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 = Omit, 'CellRendererComponent'> & CellRendererComponent?: React.ComponentType> | 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; };