mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-15 08:23:02 -03:00
feat: enhance keyboard accessibility for notification items and friends modal
This commit is contained in:
@@ -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}
|
||||
>
|
||||
|
||||
@@ -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}
|
||||
>
|
||||
|
||||
@@ -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}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user