diff --git a/src/components/SelectionList/BaseListItem.tsx b/src/components/SelectionList/BaseListItem.tsx index 42fdc7dc575e..67de9153d0d6 100644 --- a/src/components/SelectionList/BaseListItem.tsx +++ b/src/components/SelectionList/BaseListItem.tsx @@ -58,85 +58,75 @@ function BaseListItem({ }; return ( - onDismissError(item)} - pendingAction={pendingAction} - errors={errors} - errorRowStyles={styles.ph5} - style={containerStyle} + onSelectRow(item)} + disabled={isDisabled} + accessibilityLabel={item.text ?? ''} + hoverDimmingValue={1} + hoverStyle={!item.isDisabled && !item.isSelected && styles.hoveredComponentBG} + onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined} + nativeID={keyForList ?? ''} + style={pressableStyle} > - onSelectRow(item)} - disabled={isDisabled} - accessibilityLabel={item.text ?? ''} - role={CONST.ROLE.BUTTON} - hoverDimmingValue={1} - hoverStyle={!item.isDisabled && !item.isSelected && styles.hoveredComponentBG} - dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} - onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined} - nativeID={keyForList ?? ''} - style={pressableStyle} - > - - {canSelectMultiple && checkmarkPosition === CONST.DIRECTION.LEFT && ( - - - {item.isSelected && ( - - )} - - - )} - - {typeof children === 'function' ? children(hovered) : children} - - {canSelectMultiple && checkmarkPosition === CONST.DIRECTION.RIGHT && ( - - - - )} - - {!canSelectMultiple && item.isSelected && !rightHandSideComponent && ( - - + + {canSelectMultiple && checkmarkPosition === CONST.DIRECTION.LEFT && ( + + + {item.isSelected && ( - + )} + + + )} + + {typeof children === 'function' ? children(hovered) : children} + + {canSelectMultiple && checkmarkPosition === CONST.DIRECTION.RIGHT && ( + + + + )} + + {!canSelectMultiple && item.isSelected && !rightHandSideComponent && ( + + + - )} - {rightHandSideComponentRender()} - - {FooterComponent} - - + + )} + {rightHandSideComponentRender()} + + {FooterComponent} + ); } diff --git a/src/components/SelectionList/TableListItem.tsx b/src/components/SelectionList/TableListItem.tsx index b7c3ed549d82..1fb996bc13b9 100644 --- a/src/components/SelectionList/TableListItem.tsx +++ b/src/components/SelectionList/TableListItem.tsx @@ -31,10 +31,6 @@ function TableListItem({ return ( {!!item.alternateText && ( + // { navigate: jest.fn(), addListener: () => jest.fn(), }), - useIsFocused: () => true, + useIsFocused: () => true, } as typeof Navigation; }); diff --git a/tests/perf-test/SignInPage.perf-test.tsx b/tests/perf-test/SignInPage.perf-test.tsx index 651d85a70e58..dc93b0d81059 100644 --- a/tests/perf-test/SignInPage.perf-test.tsx +++ b/tests/perf-test/SignInPage.perf-test.tsx @@ -31,7 +31,7 @@ jest.mock('@react-navigation/native', () => { return { ...actualNav, useFocusEffect: jest.fn(), - useIsFocused: () => true, + useIsFocused: () => true, useRoute: () => jest.fn(), useNavigation: () => ({ navigate: jest.fn(),