From 3e8c21ac05fb4e8ea1d8d2910b5efb0bc2ee2142 Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Thu, 22 May 2025 16:20:13 +0300 Subject: [PATCH] fix: v-tippy not updating if content set to undefined --- src/directive/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/directive/index.ts b/src/directive/index.ts index 72af1a3..1eb0e21 100644 --- a/src/directive/index.ts +++ b/src/directive/index.ts @@ -68,6 +68,11 @@ const directive: Directive = { updated(el, binding) { const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {} + + // any kind of falsy content value, even undefined, should be treated as null - 'no tooltip to show' + if (!opts.content) { + opts.content = null + } if (el.getAttribute('title') && !opts.content) { opts.content = el.getAttribute('title')