Skip to content

Commit

Permalink
fix: issue on node environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisi Linhart committed Jan 18, 2024
1 parent b3a9199 commit e035ae6
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/directives/tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ export default {
const options = getOptions(binding)
const label = getLabel(binding)
let checkdelay
const wrapper = document.querySelector('#tooltip-wrapper')
const wrapper = document?.querySelector('#tooltip-wrapper')

if(!wrapper) {
return
}

function showHandler() {
if (
Expand Down Expand Up @@ -249,26 +253,6 @@ export default {
}
}

el.__tooltip = {
// options
label,
options,

// instance properties
popperInstance: null,
tooltipEl: null,

// methods
showHandler,
hideHandler,
handleKeydown,
}

el.addEventListener('mouseover', showHandler)
el.addEventListener('mouseleave', hideHandler)
el.addEventListener('focus', showHandler)
el.addEventListener('blur', hideHandler)
el.addEventListener('keydown', handleKeydown)
},

/**
Expand Down

0 comments on commit e035ae6

Please sign in to comment.