From bb9cf3055bcb8bd526543ce6107c0b273c87afb6 Mon Sep 17 00:00:00 2001 From: GENTILHOMME Thomas Date: Tue, 24 Mar 2026 23:58:25 +0100 Subject: [PATCH] fix: documentation-ui not working as expected in the UI --- .changeset/frank-pumas-fail.md | 5 +++++ public/components/wiki/wiki.js | 10 +++++----- workspaces/documentation-ui/src/components/header.ts | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/frank-pumas-fail.md diff --git a/.changeset/frank-pumas-fail.md b/.changeset/frank-pumas-fail.md new file mode 100644 index 00000000..bf9ab0db --- /dev/null +++ b/.changeset/frank-pumas-fail.md @@ -0,0 +1,5 @@ +--- +"@nodesecure/documentation-ui": patch +--- + +Add missing setTimeout to header.ts component diff --git a/public/components/wiki/wiki.js b/public/components/wiki/wiki.js index acce0106..efc14d8f 100644 --- a/public/components/wiki/wiki.js +++ b/public/components/wiki/wiki.js @@ -13,17 +13,17 @@ export class Wiki { ".open-button" ); - const { container, header, navigation } = documentationUI.render( - { preCacheAllFlags: true } - ); - const documentationRenderContainer = this.documentationRootElement.querySelector( ".documentation-render-container" ); for (const node of documentationRenderContainer.childNodes) { node.remove(); } - documentationRenderContainer.appendChild(container); + + const { header, navigation } = documentationUI.render( + documentationRenderContainer, + { prefetch: true } + ); /** @type {documentationUI.Header} */ this.header = header; diff --git a/workspaces/documentation-ui/src/components/header.ts b/workspaces/documentation-ui/src/components/header.ts index 49429115..f60bb71c 100644 --- a/workspaces/documentation-ui/src/components/header.ts +++ b/workspaces/documentation-ui/src/components/header.ts @@ -55,7 +55,7 @@ export class Header { this.active === null && (this.defaultName === null || this.defaultName === name) ) { - this.setNewActiveView(name); + setTimeout(() => this.setNewActiveView(name), 1); } liElement.addEventListener(