Skip to content

Commit 0cba88a

Browse files
#559044: [SXA] added fix for sitecore-jss-react. added exclude patterns for Splitter components
1 parent 4ea36e8 commit 0cba88a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import {
1212
import { convertAttributesToReactProps } from '../utils';
1313
import { HiddenRendering, HIDDEN_RENDERING_NAME } from './HiddenRendering';
1414

15+
const EXCLUDE_PLACEHOLDERS_RENDER = [
16+
new RegExp(/column-(\d{1})-\{\*\}/i),
17+
new RegExp(/row-(\d{1})-\{\*\}/i),
18+
];
19+
1520
type ErrorComponentProps = {
1621
[prop: string]: unknown;
1722
};
@@ -121,7 +126,10 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone
121126
from backend side we get common name of placeholder is called 'nameOfContainer-{*}' where '{*}' marker for replacing **/
122127
if (rendering?.placeholders) {
123128
Object.keys(rendering.placeholders).forEach((placeholder) => {
124-
if (placeholder.indexOf('{*}') !== -1) {
129+
if (
130+
placeholder.indexOf('{*}') !== -1 &&
131+
EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) === -1)
132+
) {
125133
rendering.placeholders[name] = rendering.placeholders[placeholder];
126134
delete rendering.placeholders[placeholder];
127135
}

0 commit comments

Comments
 (0)