feat: enhance keyboard accessibility for notification items and friends modal

This commit is contained in:
Moyasee
2025-12-16 15:20:13 +02:00
parent b8352be274
commit 6257529297
3 changed files with 16 additions and 0 deletions

View File

@@ -69,6 +69,11 @@ export function LocalNotificationItem({
"notification-item--unread": !notification.isRead,
})}
onClick={handleClick}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
handleClick();
}
}}
role="button"
tabIndex={0}
>

View File

@@ -177,6 +177,11 @@ export function NotificationItem({
"notification-item--unread": !notification.isRead,
})}
onClick={handleClick}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
handleClick();
}
}}
role="button"
tabIndex={0}
>

View File

@@ -76,6 +76,7 @@ export function AllFriendsModal({
setHasMore(true);
fetchFriends(0, false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, userId]);
const handleScroll = useCallback(() => {
@@ -152,6 +153,11 @@ export function AllFriendsModal({
key={friend.id}
className="all-friends-modal__item"
onClick={() => handleFriendClick(friend.id)}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
handleFriendClick(friend.id);
}
}}
role="button"
tabIndex={0}
>