Problem with elementor class elementorModules.frontend.handlers.Base #19418
komunik-d
announced in
Developers Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
Hi there I am developing a custom widget and I am trying to bind a custom js code, and this is the error that i get:
"featured-product-carousel.js?ver=1.0.0:1 Uncaught TypeError: Cannot read properties of undefined (reading 'handlers') "
releted to the elmentor class: "elementorModules.frontend.handlers.Base"
I also uploaded the same widget on a local instance of wordpress and it works fine.
this is my full JS:
class FeaturedProductCarouselHandler extends elementorModules.frontend.handlers.Base {
getDefaultSettings() {
return {
selectors: {
leftArrow: '.fpc-arrow-icon-left',
rightArrow: '.fpc-arrow-icon-right',
container: '.fpc-kea-slider',
},
};
}
}
onRightArrowClick( event ) {
event.preventDefault();
}
}
jQuery( window ).on( 'elementor/frontend/init', () => {
const addHandler = ( $element ) => {
elementorFrontend.elementsHandler.addHandler( FeaturedProductCarouselHandler , {
$element,
} );
console.log('handler added')
};
elementorFrontend.hooks.addAction( 'frontend/element_ready/featured_product_carousel.default', addHandler );
console.log('script loaded')
} );
Beta Was this translation helpful? Give feedback.
All reactions