diff --git a/js/modals.js b/js/modals.js index 21bc112..d721396 100644 --- a/js/modals.js +++ b/js/modals.js @@ -47,6 +47,6 @@ modal.dispatchEvent(eventToDispatch); modal.classList.toggle('active'); } - event.preventDefault(); // prevents rewriting url (apps can still use hash values in url) + if (modal) event.preventDefault(); // prevents rewriting url (apps can still use hash values in url) }); }());