Skip to content

Commit 730ec4a

Browse files
authored
fix: documentation-ui not working as expected in the UI (#698)
1 parent d93f648 commit 730ec4a

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

.changeset/frank-pumas-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nodesecure/documentation-ui": patch
3+
---
4+
5+
Add missing setTimeout to header.ts component

public/components/wiki/wiki.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ export class Wiki {
1313
".open-button"
1414
);
1515

16-
const { container, header, navigation } = documentationUI.render(
17-
{ preCacheAllFlags: true }
18-
);
19-
2016
const documentationRenderContainer = this.documentationRootElement.querySelector(
2117
".documentation-render-container"
2218
);
2319
for (const node of documentationRenderContainer.childNodes) {
2420
node.remove();
2521
}
26-
documentationRenderContainer.appendChild(container);
22+
23+
const { header, navigation } = documentationUI.render(
24+
documentationRenderContainer,
25+
{ prefetch: true }
26+
);
2727

2828
/** @type {documentationUI.Header} */
2929
this.header = header;

workspaces/documentation-ui/src/components/header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Header {
5555
this.active === null &&
5656
(this.defaultName === null || this.defaultName === name)
5757
) {
58-
this.setNewActiveView(name);
58+
setTimeout(() => this.setNewActiveView(name), 1);
5959
}
6060

6161
liElement.addEventListener(

0 commit comments

Comments
 (0)