Skip to content

Commit 941cc6a

Browse files
committed
fix: focus relative with 0 should refocus either activity or group
1 parent 440629f commit 941cc6a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/component/src/providers/TranscriptFocus/TranscriptFocusComposer.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,22 @@ const TranscriptFocusComposer = ({ children, containerRef }: TranscriptFocusComp
318318

319319
const { current: focusedActivityKey } = focusedActivityKeyRef;
320320

321+
const isHeaderFocused = !!activeGroupDescendantId;
322+
323+
if (delta === 0) {
324+
if (isHeaderFocused) {
325+
focusByGroupKey(rawFocusedActivityGroupKey, true);
326+
} else {
327+
focusByActivityKey(focusedActivityKey, true);
328+
}
329+
return;
330+
}
331+
321332
if (Math.abs(delta) > 1) {
322333
return handleDeltaNavigation(delta);
323334
}
324335

325336
const direction = delta < 0 ? 'up' : 'down';
326-
const isHeaderFocused = !!activeGroupDescendantId;
327337

328338
// Handle navigation from a focused group header
329339
if (isHeaderFocused && rawFocusedActivityGroupKey) {

0 commit comments

Comments
 (0)