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 1380cc3 commit d5ed4c0Copy full SHA for d5ed4c0
src/script/components/Modals/PrimaryModal/PrimaryModalShell/PrimaryModalShell.tsx
@@ -56,9 +56,14 @@ export const PrimaryModalShell = ({
56
return undefined;
57
}
58
59
- const detachedWindowRoot = (container as HTMLElement).querySelector?.('#detached-window') as HTMLElement;
+ // Safety check
60
+ const element = container instanceof HTMLElement ? container : null;
61
+ if (!element?.querySelector) {
62
+ return undefined;
63
+ }
64
- if (!detachedWindowRoot) {
65
+ const detachedWindowRoot = element.querySelector('#detached-window');
66
+ if (!detachedWindowRoot || !(detachedWindowRoot instanceof HTMLElement)) {
67
68
69
0 commit comments