fix: v-tippy not updating if content set to undefined
This commit is contained in:
@@ -69,6 +69,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')
|
||||
el.removeAttribute('title')
|
||||
|
||||
Reference in New Issue
Block a user