fix selected menu item not updating correctly
This commit is contained in:
1 parent
2986423789
commit
1738e7ac6f
1 file changed
+3
-1
@@ -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