We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adcd13f commit 93f7eccCopy full SHA for 93f7ecc
site/src/components/TopNav.svelte
@@ -35,12 +35,21 @@
35
};
36
});
37
38
+ // Prevents navbar to show/hide when clicking in docs sidebar
39
+ let hash_changed = false;
40
+ function handle_hashchange() {
41
+ hash_changed = true;
42
+ }
43
+
44
let last_scroll = 0;
45
function handle_scroll() {
46
const scroll = window.pageYOffset;
- visible = (scroll < 50 || scroll < last_scroll);
47
+ if (!hash_changed) {
48
+ visible = (scroll < 50 || scroll < last_scroll);
49
50
51
last_scroll = scroll;
52
+ hash_changed = false;
53
}
54
</script>
55
@@ -227,7 +236,7 @@
227
236
228
237
</style>
229
238
230
-<svelte:window on:scroll={handle_scroll}/>
239
+<svelte:window on:hashchange={handle_hashchange} on:scroll={handle_scroll} />
231
240
232
241
<header class:visible="{visible || open}">
233
242
<nav>
0 commit comments