diff --git a/components/ILIAS/Contact/resources/buddy_system.js b/components/ILIAS/Contact/resources/buddy_system.js index 1b5277d499d3..2f4aec6920cd 100755 --- a/components/ILIAS/Contact/resources/buddy_system.js +++ b/components/ILIAS/Contact/resources/buddy_system.js @@ -250,7 +250,7 @@ }) .on('click', trigger_selector, onWidgetClick); - document.addEventListener('click', clearAllDropDowns, true); + document.addEventListener('click', clearAllDropDowns); }, }; diff --git a/components/ILIAS/UI/src/Implementation/Component/Input/ViewControl/Renderer.php b/components/ILIAS/UI/src/Implementation/Component/Input/ViewControl/Renderer.php index 9feb91c72cf8..ca30618b12ca 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Input/ViewControl/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Input/ViewControl/Renderer.php @@ -101,14 +101,17 @@ function(event, signal_data) { });" ); } - $component = $component->withAdditionalOnLoadCode( - fn($id) => "$('#{$id} > .dropdown-menu') - .on('click', (event) => event.stopPropagation());" + fn($id) => " + document.querySelector('#$id ul.dropdown-menu').addEventListener( + 'click', + (event) => event.stopPropagation() + )" ); + $component = $component->withAdditionalOnLoadCode( fn($id) => - "il.UI.dropdown.init(document.getElementById(\"$id\"));" + "il.UI.dropdown.init(document.getElementById('$id'));" ); $id = $this->bindJavaScript($component);