Add keyboard activation to the interactive elements and use stable keys. [skip build]
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from 'matrix-js-sdk';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { onEnterOrSpace } from '../../utils/keyboard';
|
||||
import { WindowControls } from './WindowControls';
|
||||
import { UpdateNotification } from '../update-notification';
|
||||
import * as css from './TitleBar.css';
|
||||
@@ -688,6 +689,9 @@ export function TitleBar({ mx, children }: TitleBarProps) {
|
||||
{notifications.map((notification) => (
|
||||
<div
|
||||
key={notification.id}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onKeyDown={onEnterOrSpace(handleNotificationClick(notification))}
|
||||
className={`${css.NewMessagePill} ${notification.exiting ? css.NewMessagePillExiting : ''}`}
|
||||
onClick={handleNotificationClick(notification)}
|
||||
onMouseDown={(e) => e.stopPropagation()}
|
||||
|
||||
Reference in New Issue
Block a user