I have a wordpress site where I'm getting the following error in the developer console using chrome:
[Intervention] Unable to preventDefault inside passive event listener due to
target being treated as passive.
I have one javascript snippet where I set 4 listeners:
function moveDown(){
const submenus = document.getElementsByClassName('sub-menu')
var navbar = document.getElementById("menu-1");
var sub = this.getElementsByTagName('ul')[0]
var rect = sub.getBoundingClientRect();
navbar.style.marginBottom = rect.height + "px"
}
function moveUp(event){
var navbar = document.getElementById("menu-1");
navbar.style.marginBottom = 0
}
(function(){
var takeAction = document.getElementsByClassName('takeAction')[0]
var aboutUs = document.getElementsByClassName('aboutUs')[0]
aboutUs.addEventListener('mouseover', moveDown,{passive: false})
takeAction.addEventListener('mouseover', moveDown,{passive: false})
aboutUs.addEventListener('mouseleave', function(event) {moveUp(event)},{passive: false})
takeAction.addEventListener('mouseleave', function(event) {moveUp(event)},{passive: false})
})()
Since I'm already setting {passive:false}
on each listener, how do I fix this?
problem has gone away. seems like a wordpress thing but who knows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With