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:
parent
c824c4a858
commit
43ffd89e58
3 changed files with 24 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue