fix: keep a click on a message row from costing an extra render

This commit is contained in:
Linus Rath
2026-10-29 19:01:36 +01:00
parent f24c481839
commit 8333870c82
+6 -2
View File
@@ -565,7 +565,9 @@ const SingleEmailItem = React.forwardRef<HTMLDivElement, SingleEmailItemProps>(
{...touchHandlers}
data-testid="email-list-item"
onPointerOver={armHoverActions}
onFocus={armHoverActions}
// The row itself takes focus on click and from the keyboard; its actions
// come from Shift+F10 there, so only a control inside it arms them.
onFocus={(e) => { if (e.target !== e.currentTarget) armHoverActions(); }}
onPointerDown={(e) => { if (onPrefetch && isMousePressOnRow(e)) onPrefetch(); }}
data-email-id={email.id}
data-subject={email.subject || ''}
@@ -1266,7 +1268,9 @@ export const ThreadListItem = React.forwardRef<HTMLDivElement, ThreadListItemPro
{...dragHandlers}
{...threadTouchHandlers}
onPointerOver={armHoverActions}
onFocus={armHoverActions}
// The row itself takes focus on click and from the keyboard; its actions
// come from Shift+F10 there, so only a control inside it arms them.
onFocus={(e) => { if (e.target !== e.currentTarget) armHoverActions(); }}
onPointerDown={(e) => { if (onPrefetch && isMousePressOnRow(e)) onPrefetch(latestEmail); }}
{...rowA11yProps({
rowKey: emailKeyFor(latestEmail),