Skip to content

Commit

Permalink
Fix: accordion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sifat009 committed Jun 14, 2022
1 parent 650abe7 commit b502015
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion assets/reactjs/src/blocks/accordion/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class AccordionBlock extends Component {
},
} = this.props;

if(!uniqueId) setAttributes({uniqueId: clientId.substr(0, 6)})

return (
<Fragment>
<InspectorControls>
Expand All @@ -85,7 +87,7 @@ class AccordionBlock extends Component {
setAttributes
})}

<div className={`qubely-block-accordion qubely-block-${clientId}${className ? ` ${className}` : ""}`}>
<div className={`qubely-block-accordion qubely-block-${uniqueId}${className ? ` ${className}` : ""}`}>
<InnerBlocks
template={this.getAccordionTemplate(attributes)}
allowedBlocks={["qubely/accordion-item"]}
Expand Down
5 changes: 2 additions & 3 deletions assets/reactjs/src/blocks/accordion/Save.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ const {
} = wp.qubelyComponents;
class Save extends Component {
render() {
const { clientId, attributes } = this.props;
const { animation, uniqueId, itemToggle, interaction } = attributes;
const { animation, uniqueId, itemToggle, interaction } = this.props.attributes;
const interactionClass = IsInteraction(interaction) ? "qubley-block-interaction" : "";
const className = `qubely-block-accordion ${interactionClass} qubely-block-${clientId}`;
const className = `qubely-block-accordion ${interactionClass} qubely-block-${uniqueId}`;
return (
<div className={className} {...animationAttr(animation)} data-item-toggle={itemToggle}>
<InnerBlocks.Content />
Expand Down

0 comments on commit b502015

Please sign in to comment.