From de1c25f9db51db8c1b1ac35c2c125a2f9d196210 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 4b495cf663..9dabd0756b 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);