webui : improve accessibility for visually impaired people (#13551)
* webui : improve accessibility for visually impaired people * add a11y for extra contents * fix some labels being read twice * add skip to main content
This commit is contained in:
parent
06c1e4abc1
commit
aea9f8b4e7
10 changed files with 147 additions and 48 deletions
|
@ -52,13 +52,20 @@ export function BtnWithTooltips({
|
|||
tooltipsContent: string;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
// the onClick handler is on the container, so screen readers can safely ignore the inner button
|
||||
// this prevents the label from being read twice
|
||||
return (
|
||||
<div className="tooltip tooltip-bottom" data-tip={tooltipsContent}>
|
||||
<div
|
||||
className="tooltip tooltip-bottom"
|
||||
data-tip={tooltipsContent}
|
||||
role="button"
|
||||
onClick={onClick}
|
||||
>
|
||||
<button
|
||||
className={`${className ?? ''} flex items-center justify-center`}
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
onMouseLeave={onMouseLeave}
|
||||
aria-hidden={true}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue