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 55b4650 commit 0d50ed9Copy full SHA for 0d50ed9
dialog/internal/dialog.ts
@@ -150,7 +150,9 @@ export class Dialog extends dialogBaseClass {
150
private escapePressedWithoutCancel = false;
151
// This TreeWalker is used to walk through a dialog's children to find
152
// focusable elements. TreeWalker is faster than `querySelectorAll('*')`.
153
- private readonly treewalker = document.createTreeWalker(
+ // We check for isServer because there isn't a "document" during an SSR
154
+ // run.
155
+ private readonly treewalker = isServer ? {} : document.createTreeWalker(
156
this,
157
NodeFilter.SHOW_ELEMENT,
158
);
0 commit comments