Set tab order based on block's order

This commit is contained in:
Matt Sherman 2023-10-19 08:23:44 -04:00
parent 97dc41e2aa
commit 4605f7ee57
1 changed files with 6 additions and 1 deletions

View File

@ -26,7 +26,12 @@ export function Edit( {
context,
}: ProductEditorBlockEditProps< TabBlockAttributes > ) {
const blockProps = useWooBlockProps( attributes );
const { id, title, order, isSelected: contextIsSelected } = attributes;
const {
id,
title,
_templateBlockOrder: order,
isSelected: contextIsSelected,
} = attributes;
const isSelected = context.selectedTab === id;
if ( isSelected !== contextIsSelected ) {
setAttributes( { isSelected } );