From 94e893bebef333cf65f02ba2df98506b83e864f8 Mon Sep 17 00:00:00 2001 From: Laurent Bardin Date: Thu, 19 Feb 2026 19:40:43 +0100 Subject: [PATCH] Skip replaced elements when initialising tooltips Tooltips use `::before` and `::after`, which cannot work on replaced elements, the most common of which is ``. We skip those elements when initialising the tooltips so that their `title` attribute is not removed and it can still be displayed by the browser when hovering over them. --- docs/content/components/tooltip.md | 12 ++++++++++++ src/js/tooltip.js | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/docs/content/components/tooltip.md b/docs/content/components/tooltip.md index 0d05db4..062d415 100644 --- a/docs/content/components/tooltip.md +++ b/docs/content/components/tooltip.md @@ -13,3 +13,15 @@ Use the standard `title` attribute on any element to render a tooltip with smoot Profile ``` {% end %} + +### Special Elements + +The technique used to display these tooltips won't work on a few HTML elements, most notably ``, so the native browser tooltip will be shown. To work around this issue, simply wrap those elements into another (e.g. `
` or ``), and move the `title` attribute onto that parent element: + +```html + + + +``` + +Other elements affected by this are ``, `