Skip to content

Commit

Permalink
fix(EuiPageTemplate): replace CSS.escape usage with string replace …
Browse files Browse the repository at this point in the history
…to fix SSR support (#7525)
  • Loading branch information
tkajtoch authored Feb 13, 2024
1 parent b06a6e2 commit 13a1314
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/upcoming/7525.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed the `CSS is not defined` bug in `EuiPageTemplate` when rendering in some SSR environments, particularly Next.js v13 and up
2 changes: 1 addition & 1 deletion src/components/page_template/page_template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const _EuiPageTemplate: FunctionComponent<EuiPageTemplateProps> = ({
restrictWidth,
paddingSize,
// pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
parent: `#${CSS.escape(pageInnerId)}`,
parent: `#${pageInnerId.replaceAll(':', '\\:')}`,
});

const innerPanelled = () => panelled ?? Boolean(sidebar.length > 0);
Expand Down

0 comments on commit 13a1314

Please sign in to comment.