fix selected menu item not updating correctly
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user