fix selected menu item not updating correctly
All checks were successful
deploy / build-and-deploy (push) Successful in 15s
All checks were successful
deploy / build-and-deploy (push) Successful in 15s
This commit is contained in:
@@ -67,7 +67,9 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
updateActiveNavPath();
|
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
|
// functions
|
||||||
|
|||||||
Reference in New Issue
Block a user