Skip to content

Commit 51de5fc

Browse files
committed
Fix selected row background mismatch between wrapper and pressable on narrow screens
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
1 parent ec8ffdc commit 51de5fc

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/components/Search/SearchList/ListItem/ExpenseReportListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function ExpenseReportListItem<TItem extends ListItem>({
199199
borderRadius: 0,
200200
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
201201
highlightColor: theme.messageHighlightBG,
202-
backgroundColor: theme.highlightBG,
202+
backgroundColor: item.isSelected ? theme.activeComponentBG : theme.highlightBG,
203203
shouldApplyOtherStyles: !isLargeScreenWidth,
204204
});
205205

src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,15 @@ function TransactionGroupListItem<TItem extends ListItem>({
198198
};
199199

200200
const StyleUtils = useStyleUtils();
201+
const isItemSelected = isSelectAllChecked || item?.isSelected;
201202

202203
const animatedHighlightStyle = useAnimatedHighlightStyle({
203204
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
204205
highlightColor: theme.messageHighlightBG,
205-
backgroundColor: theme.highlightBG,
206+
backgroundColor: isItemSelected ? theme.activeComponentBG : theme.highlightBG,
206207
shouldApplyOtherStyles: false,
207208
});
208209

209-
const isItemSelected = isSelectAllChecked || item?.isSelected;
210-
211210
const pressableStyle = [
212211
styles.transactionGroupListItemStyle,
213212
isLargeScreenWidth && {

src/components/Search/SearchList/ListItem/TransactionListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function TransactionListItem<TItem extends ListItem>({
130130
borderRadius: 0,
131131
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
132132
highlightColor: theme.messageHighlightBG,
133-
backgroundColor: theme.highlightBG,
133+
backgroundColor: item.isSelected ? theme.activeComponentBG : theme.highlightBG,
134134
shouldApplyOtherStyles: !isLargeScreenWidth,
135135
});
136136

0 commit comments

Comments
 (0)