Skip to content

Commit

Permalink
Fix error on README page with expanded entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Nov 6, 2021
1 parent 774aa36 commit 0853a1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
### Bug Fixes

- Actually fixed `@category` tag incorrectly appearing on function types if used on a type alias, #1745.
- Fix error in console when a page contains no documentation items.

## v0.22.7 (2021-10-25)

Expand Down
Expand Up @@ -39,8 +39,9 @@ export class Viewport extends EventTarget {

/**
* The sticky side nav that contains members of the current page.
* Might not present on the home page if the project uses `entryPointStrategy` set to `Expand`.
*/
secondaryNav: HTMLElement;
secondaryNav?: HTMLElement;

/**
* Create new Viewport instance.
Expand All @@ -51,7 +52,7 @@ export class Viewport extends EventTarget {
this.toolbar = <HTMLDivElement>(
document.querySelector(".tsd-page-toolbar")
);
this.secondaryNav = <HTMLElement>(
this.secondaryNav = <HTMLElement | undefined>(
document.querySelector(".tsd-navigation.secondary")
);

Expand Down Expand Up @@ -123,7 +124,7 @@ export class Viewport extends EventTarget {
this.showToolbar = this.lastY >= this.scrollTop || this.scrollTop <= 0;
if (isShown !== this.showToolbar) {
this.toolbar.classList.toggle("tsd-page-toolbar--hide");
this.secondaryNav.classList.toggle("tsd-navigation--toolbar-hide");
this.secondaryNav?.classList.toggle("tsd-navigation--toolbar-hide");
}
this.lastY = this.scrollTop;
}
Expand Down

0 comments on commit 0853a1a

Please sign in to comment.