diff --git a/packages/TPS/Shop/src/Resources/views/shop/layouts/header/category-nav.blade.php b/packages/TPS/Shop/src/Resources/views/shop/layouts/header/category-nav.blade.php index 0757ca0e3..9240c13e9 100644 --- a/packages/TPS/Shop/src/Resources/views/shop/layouts/header/category-nav.blade.php +++ b/packages/TPS/Shop/src/Resources/views/shop/layouts/header/category-nav.blade.php @@ -235,8 +235,20 @@ setLoading(loading) { this.loading = loading document.querySelector('a.categories').style.opacity = loading ? 0 : 1 + }, + handleClickOutside(event) { + if (!this.$el.contains(event.target)) { + // Close the modal + console.log('outside'); + } } - } + }, + mounted() { + document.addEventListener('click', this.handleClickOutside); + }, + beforeDestroy() { + document.removeEventListener('click', this.handleClickOutside); + }, })