Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type {BaseListItemProps, ExtendedTargetedEvent, ListItem, SelectionListPr
type BaseSelectionListItemRendererProps<TItem extends ListItem> = Omit<BaseListItemProps<TItem>, 'onSelectRow'> &
Pick<SelectionListProps<TItem>, 'ListItem' | 'shouldIgnoreFocus' | 'shouldSingleExecuteRowSelect' | 'canShowProductTrainingTooltip'> & {
index: number;
sectionIndex?: number;
selectRow: (item: TItem, indexToFocus?: number) => void;
setFocusedIndex: ReturnType<typeof useArrowKeyFocusManager>[1];
normalizedIndex: number;
Expand All @@ -27,6 +28,7 @@ function BaseSelectionListItemRenderer<TItem extends ListItem>({
ListItem,
item,
index,
sectionIndex,
isFocused,
isDisabled,
showTooltip,
Expand Down Expand Up @@ -113,6 +115,7 @@ function BaseSelectionListItemRenderer<TItem extends ListItem>({
userBillingFundID={userBillingFundID}
index={index}
shouldShowRightCaret={shouldShowRightCaret}
sectionIndex={sectionIndex}
/>
{item.footerContent && item.footerContent}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ function BaseSelectionListWithSections<TItem extends ListItem>({
}}
shouldUseDefaultRightHandSideCheckmark={shouldUseDefaultRightHandSideCheckmark}
index={index}
sectionIndex={section?.indexOffset}
isFocused={isItemFocused}
isDisabled={isDisabled}
showTooltip={shouldShowTooltips}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function InviteMemberListItem<TItem extends ListItem>({
shouldSyncFocus,
wrapperStyle,
canShowProductTrainingTooltip = true,
index = 0,
sectionIndex = 0,
}: InviteMemberListItemProps<TItem>) {
const styles = useThemeStyles();
const theme = useTheme();
Expand Down Expand Up @@ -107,6 +109,7 @@ function InviteMemberListItem<TItem extends ListItem>({
shiftHorizontal={variables.inviteMemberListItemTooltipShiftHorizontal}
shouldHideOnNavigate
wrapperStyle={styles.productTrainingTooltipWrapper}
uniqueID={`${sectionIndex}-${index}`}
>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}>
{(!!item.reportID || !!accountID || !!item.text || !!item.alternateText) && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/SelectionListWithSections/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ type TransactionSelectionListItem<TItem extends ListItem> = ListItemProps<TItem>
type InviteMemberListItemProps<TItem extends ListItem> = UserListItemProps<TItem> & {
/** Whether product training tooltips can be displayed */
canShowProductTrainingTooltip?: boolean;
index?: number;
sectionIndex?: number;
};

type UserSelectionListItemProps<TItem extends ListItem> = UserListItemProps<TItem>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type LayoutChangeEventWithTarget = NativeSyntheticEvent<{layout: LayoutRectangle
* A component used to wrap an element intended for displaying a tooltip.
* This tooltip would show immediately without user's interaction and hide after 5 seconds.
*/
function BaseEducationalTooltip({children, shouldRender = false, shouldHideOnNavigate = true, shouldHideOnScroll = false, ...props}: EducationalTooltipProps) {
function BaseEducationalTooltip({children, shouldRender = false, shouldHideOnNavigate = true, shouldHideOnScroll = false, uniqueID, ...props}: EducationalTooltipProps) {
const genericTooltipStateRef = useRef<GenericTooltipState | undefined>(undefined);
const tooltipElementRef = useRef<Readonly<NativeMethods> | undefined>(undefined);

Expand Down Expand Up @@ -82,7 +82,7 @@ function BaseEducationalTooltip({children, shouldRender = false, shouldHideOnNav
// This is necessary to ensure the tooltip is positioned correctly after resizing
renderTooltip();
}
}, [isResizing, renderTooltip, shouldRender]);
}, [isResizing, renderTooltip, shouldRender, uniqueID]);

const setTooltipPosition = useCallback(
(isScrolling: boolean) => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Tooltip/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ type EducationalTooltipProps = ChildrenProps &

/** Whether the tooltip should hide during scrolling */
shouldHideOnScroll?: boolean;

uniqueID?: string;
};

type TooltipExtendedProps = (EducationalTooltipProps | TooltipProps) & {
Expand Down