Fix accessibility issues around the room list and space panel (#10717)

* Fix room sublist group label being read twice in Orca

* Fix room list sublist notification badges always having a tab stop
This commit is contained in:
Michael Telatynski 2023-05-05 11:09:41 +01:00 committed by GitHub
parent c824c4a858
commit 43ffd89e58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 6 deletions

View file

@ -21,19 +21,32 @@ import { formatCount } from "../../../../utils/FormattingUtils";
import AccessibleButton from "../../elements/AccessibleButton";
import { NotificationColor } from "../../../../stores/notifications/NotificationColor";
import { useSettingValue } from "../../../../hooks/useSettings";
import { XOR } from "../../../../@types/common";
interface Props {
symbol: string | null;
count: number;
color: NotificationColor;
onClick?: (ev: MouseEvent) => void;
onMouseOver?: (ev: MouseEvent) => void;
onMouseLeave?: (ev: MouseEvent) => void;
children?: ReactNode;
label?: string;
}
export function StatelessNotificationBadge({ symbol, count, color, ...props }: Props): JSX.Element {
interface ClickableProps extends Props {
/**
* If specified will return an AccessibleButton instead of a div.
*/
onClick(ev: React.MouseEvent): void;
tabIndex?: number;
}
export function StatelessNotificationBadge({
symbol,
count,
color,
...props
}: XOR<Props, ClickableProps>): JSX.Element {
const hideBold = useSettingValue("feature_hidebold");
// Don't show a badge if we don't need to