From 38e6eaf3f4ab124d5bfff452cad5efcc2d2a56c1 Mon Sep 17 00:00:00 2001 From: WofWca Date: Tue, 7 Jan 2025 16:38:24 +0400 Subject: [PATCH] improvement: a11y RovingTabindex for loading msgs --- .../src/components/message/MessageList.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/message/MessageList.tsx b/packages/frontend/src/components/message/MessageList.tsx index 4007061ba2..c570df6342 100644 --- a/packages/frontend/src/components/message/MessageList.tsx +++ b/packages/frontend/src/components/message/MessageList.tsx @@ -827,7 +827,6 @@ export const MessageListInner = React.memo( /> ) } else if (message?.kind === 'loadingError') { - // TODO shall we add `useRovingTabindex` here as well? return ( } } @@ -866,13 +864,20 @@ function MessageLoadingError({ messageId: T.MessageListItem & { kind: 'message' } message: T.MessageLoadResult }) { + const ref = useRef(null) + const rovingTabindex = useRovingTabindex(ref) + return (
loading message {messageId.msg_id} failed: {message.error}
@@ -884,13 +889,20 @@ function MessageLoading({ }: { messageId: T.MessageListItem & { kind: 'message' } }) { + const ref = useRef(null) + const rovingTabindex = useRovingTabindex(ref) + return (
Loading Message {messageId.msg_id}