diff --git a/resources/assets/js/forms.js b/resources/assets/js/forms.js index 26557a13..2280e7cb 100644 --- a/resources/assets/js/forms.js +++ b/resources/assets/js/forms.js @@ -313,3 +313,15 @@ ready(() => { }); } }); + +/** + * Prevent scrolling on # links in menu + */ +ready(() => { + const elements = document.querySelectorAll('.navbar a[href="#"]'); + elements.forEach((a) => { + a.addEventListener('click', (e) => { + e.preventDefault(); + }); + }); +});