diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 78cc9ec2b..0819b0363 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -126,6 +126,20 @@ }, 2000); // 2-second debounce delay } + // Modify navigation links to preserve the filter query + this.$nextTick(() => { + this.$refs.links.querySelectorAll('a').forEach(link => { + link.addEventListener('click', event => { + event.preventDefault(); + const href = new URL(link.href); + this.$router.push({ + path: href.pathname, + query: { ...this.$route.query }, // Add existing query params to the new path + }); + }); + }); + }); + // Don't show the nav until the state is set this.loaded = true; },