]> source.dussan.org Git - gitea.git/commitdiff
Add aria attributes to interactive time tooltips. (#23661)
authorFelipe Leopoldo Sologuren GutiƩrrez <fsologureng@users.noreply.github.com>
Fri, 24 Mar 2023 09:43:52 +0000 (06:43 -0300)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2023 09:43:52 +0000 (17:43 +0800)
Fixes #23645
* Added `describedby` attribute to the reference element.
* Eliminated `aria-expanded` attribute to the reference element in order
to conform strictly with WCAG 2.1 rules.

web_src/js/modules/tippy.js

index 98d0ff84b6062a842f00e648f336a59d7609270d..1f7a0eaf4fefb885b2948400d9113e581c4aaf08 100644 (file)
@@ -44,7 +44,7 @@ function attachTooltip(target, content = null) {
     delay: 100,
     role: 'tooltip',
     placement: target.getAttribute('data-tooltip-placement') || 'top-start',
-    ...(target.getAttribute('data-tooltip-interactive') === 'true' ? {interactive: true} : {}),
+    ...(target.getAttribute('data-tooltip-interactive') === 'true' ? {interactive: true, aria: {content: 'describedby', expanded: false}} : {}),
   };
 
   if (!target._tippy) {