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:
Xuan-Son Nguyen 2025-05-16 21:49:01 +02:00 committed by GitHub
parent 06c1e4abc1
commit aea9f8b4e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 147 additions and 48 deletions

View file

@ -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>