fix selected menu item not updating correctly
All checks were successful
deploy / build-and-deploy (push) Successful in 15s

This commit is contained in:
2025-10-13 18:42:03 +02:00
parent ce5a18d028
commit 81d1f6c82c

View File

@@ -67,7 +67,9 @@
onMount(() => {
updateActiveNavPath();
new MutationObserver(updateActiveNavPath).observe(document.head, { childList: true });
// the mutation observer callback runs too fast, hence the call to `updateActiveNavPath` must be wrapped in an empty
// setTimeout to not cause any visual bugs
new MutationObserver(() => setTimeout(updateActiveNavPath)).observe(document.head, { childList: true });
});
// functions