Skip to content

Commit b502015

Browse files
committed
Fix: accordion issue
1 parent 650abe7 commit b502015

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

assets/reactjs/src/blocks/accordion/Edit.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class AccordionBlock extends Component {
6565
},
6666
} = this.props;
6767

68+
if(!uniqueId) setAttributes({uniqueId: clientId.substr(0, 6)})
69+
6870
return (
6971
<Fragment>
7072
<InspectorControls>
@@ -85,7 +87,7 @@ class AccordionBlock extends Component {
8587
setAttributes
8688
})}
8789

88-
<div className={`qubely-block-accordion qubely-block-${clientId}${className ? ` ${className}` : ""}`}>
90+
<div className={`qubely-block-accordion qubely-block-${uniqueId}${className ? ` ${className}` : ""}`}>
8991
<InnerBlocks
9092
template={this.getAccordionTemplate(attributes)}
9193
allowedBlocks={["qubely/accordion-item"]}

assets/reactjs/src/blocks/accordion/Save.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ const {
55
} = wp.qubelyComponents;
66
class Save extends Component {
77
render() {
8-
const { clientId, attributes } = this.props;
9-
const { animation, uniqueId, itemToggle, interaction } = attributes;
8+
const { animation, uniqueId, itemToggle, interaction } = this.props.attributes;
109
const interactionClass = IsInteraction(interaction) ? "qubley-block-interaction" : "";
11-
const className = `qubely-block-accordion ${interactionClass} qubely-block-${clientId}`;
10+
const className = `qubely-block-accordion ${interactionClass} qubely-block-${uniqueId}`;
1211
return (
1312
<div className={className} {...animationAttr(animation)} data-item-toggle={itemToggle}>
1413
<InnerBlocks.Content />

0 commit comments

Comments
 (0)