From c2dff26afa84c5020f39cb6987886200a1bee54f Mon Sep 17 00:00:00 2001 From: Laurent GAY Date: Tue, 7 Oct 2025 15:45:52 +0200 Subject: [PATCH] Accessibility: correction after return of HAN - #1785 + #1853 --- src/utils/html.ts | 6 ++++++ src/views/Event/CalendarView.vue | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/utils/html.ts b/src/utils/html.ts index 7f0ac34a9..3e3b1066c 100644 --- a/src/utils/html.ts +++ b/src/utils/html.ts @@ -15,3 +15,9 @@ export function escapeHtml(html: string) { return escapedContent; } + +export function getElementByXPath(path: string) { + return new XPathEvaluator() + .createExpression(path) + .evaluate(document, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue; +} diff --git a/src/views/Event/CalendarView.vue b/src/views/Event/CalendarView.vue index 4b7a2cfdf..ac3db0d03 100644 --- a/src/views/Event/CalendarView.vue +++ b/src/views/Event/CalendarView.vue @@ -14,6 +14,19 @@ import { useI18n } from "vue-i18n"; import EventsAgenda from "@/components/FullCalendar/EventsAgenda.vue"; import EventsCalendar from "@/components/FullCalendar/EventsCalendar.vue"; +import { onMounted } from "vue"; +import { getElementByXPath } from "@/utils/html"; + +onMounted(() => { + const icon_left = getElementByXPath( + "//span[contains(@class,'fc-icon-chevron-left')]" + ); + icon_left.setAttribute("aria-label", t("Previous")); + const icon_right = getElementByXPath( + "//span[contains(@class,'fc-icon-chevron-right')]" + ); + icon_right.setAttribute("aria-label", t("Next")); +}); const { t } = useI18n({ useScope: "global" });