Merge pull request 'Fix issue/comment menus' (#6419) from fnetx/issue-view-a11y into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6419
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Otto 2024-12-30 20:28:53 +00:00
commit ceee649086
7 changed files with 39 additions and 8 deletions

View file

@ -103,7 +103,10 @@ function switchTitleToTooltip(target) {
}
}
target.setAttribute('data-tooltip-content', title);
target.setAttribute('aria-label', title);
// only replace if not explicitly set
if (target.getAttribute('aria-label') !== null) {
target.setAttribute('aria-label', title);
}
// keep the attribute, in case there are some other "[title]" selectors
// and to prevent infinite loop with <relative-time> which will re-add
// title if it is absent