Skip to content

Commit

Permalink
fix: add check for document
Browse files Browse the repository at this point in the history
  • Loading branch information
chargome committed Sep 19, 2024
1 parent d89cf20 commit e374a10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/components/codeKeywords/keywordSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ export function KeywordSelector({keyword, group, index}: KeywordSelectorProps) {
</AnimatePresence>
</span>
</KeywordDropdown>
<div>
{createPortal(<AnimatePresence>{selector}</AnimatePresence>, document.body)}
</div>
{document &&
createPortal(<AnimatePresence>{selector}</AnimatePresence>, document.body)}
</Fragment>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/codeKeywords/orgAuthTokenCreator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ export function OrgAuthTokenCreator() {
</AnimatePresence>
</span>
</KeywordDropdown>

{createPortal(<AnimatePresence>{selector}</AnimatePresence>, document.body)}
{document &&
createPortal(<AnimatePresence>{selector}</AnimatePresence>, document.body)}
</Fragment>
);
}

0 comments on commit e374a10

Please sign in to comment.