From 09ee93d3320dae313c54ae4c6b2e13bf2eb99076 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 10 May 2023 15:15:27 -0400 Subject: [PATCH] Use tooltips as aria-labels --- packages/client/src/directives/tooltip.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/client/src/directives/tooltip.ts b/packages/client/src/directives/tooltip.ts index 4b495cf66..9dabd0756 100644 --- a/packages/client/src/directives/tooltip.ts +++ b/packages/client/src/directives/tooltip.ts @@ -20,6 +20,12 @@ export default { self.hideTimer = null; self.checkTimer = null; + if (!binding.modifiers.noLabel) { + if (!document.body.contains(el)) return; + if (self.text == null) return; + el.setAttribute("aria-label", self.text); + } + self.close = () => { if (self._close) { window.clearInterval(self.checkTimer);