Skip to content

Commit 4073e9d

Browse files
committed
Fix narrow layout on medium screens when horizontal scroll is active
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
1 parent dd2a2ee commit 4073e9d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ type MoneyRequestReportTransactionItemProps = {
7373

7474
/** Whether this is the last item in the list */
7575
isLastItem?: boolean;
76+
77+
/** Whether the list is horizontally scrollable */
78+
shouldScrollHorizontally?: boolean;
7679
};
7780

7881
function MoneyRequestReportTransactionItem({
@@ -93,6 +96,7 @@ function MoneyRequestReportTransactionItem({
9396
shouldBeHighlighted,
9497
nonPersonalAndWorkspaceCards,
9598
isLastItem = false,
99+
shouldScrollHorizontally = false,
96100
}: MoneyRequestReportTransactionItemProps) {
97101
const {translate} = useLocalize();
98102
const styles = useThemeStyles();
@@ -164,7 +168,7 @@ function MoneyRequestReportTransactionItem({
164168
amountColumnSize={amountColumnSize}
165169
taxAmountColumnSize={taxAmountColumnSize}
166170
shouldShowTooltip
167-
shouldUseNarrowLayout={shouldUseNarrowLayout || isMediumScreenWidth}
171+
shouldUseNarrowLayout={shouldUseNarrowLayout || (isMediumScreenWidth && !shouldScrollHorizontally)}
168172
shouldShowCheckbox={!!isSelectionModeEnabled || !isSmallScreenWidth}
169173
onCheckboxPress={toggleTransaction}
170174
columns={columns}

src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ function MoneyRequestReportTransactionList({
593593
onArrowRightPress={handleArrowRightPress}
594594
nonPersonalAndWorkspaceCards={nonPersonalAndWorkspaceCards ?? {}}
595595
isLastItem={!showPendingExpensePlaceholder && transaction.transactionID === lastTransactionID}
596+
shouldScrollHorizontally={shouldScrollHorizontally}
596597
/>
597598
);
598599

0 commit comments

Comments
 (0)