Skip to content

Commit 4299a4c

Browse files
authored
feat: css handle in LayoutContainer to prevent CLS issues
2 parents a088041 + b61f20a commit 4299a4c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Class to `<div>` elements in `LayoutContainer` to manipulate those sections
13+
1014
## [8.135.0] - 2024-12-09
1115

1216
## [8.134.11] - 2024-09-30

react/components/LayoutContainer.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ const Container: FunctionComponent<ContainerProps> = ({
4343
if (elements === '__children__') {
4444
return <>{children}</>
4545
}
46+
47+
const elementIdRegex = /#(.*)/
48+
const elementId = elements.match(elementIdRegex)
49+
const containerClass = !elements.includes('fold')
50+
? `vtex-render__container-id-${elementId ? elementId[1] : elements}`
51+
: ''
4652
return (
47-
<div className={isRow ? '' : className}>
53+
<div className={isRow ? containerClass : className}>
4854
<ExtensionPoint id={elements} {...props} />
4955
</div>
5056
)

0 commit comments

Comments
 (0)