CYS: fix selected header/footer pattern (#49788)

* CYS: fix selected header/footer pattern

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Luigi Teschio 2024-07-23 10:59:08 +02:00 committed by GitHub
parent 7e54c5a589
commit 440442f0fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -2,7 +2,6 @@
* External dependencies
*/
import { BlockInstance } from '@wordpress/blocks';
import { isEqual } from 'lodash';
/**
* Internal dependencies
@ -24,12 +23,12 @@ export const findPatternByBlock = (
''
);
}
return patterns.find( ( pattern ) => {
const patternBlocks = pattern.blocks[ 0 ];
if ( patternBlocks.innerBlocks.length !== block.innerBlocks.length ) {
return false;
}
return isEqual( patternBlocks.attributes, blockAttributes );
return (
patternBlocks.attributes.className === block.attributes.className
);
} );
};

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
CYS: fix selected header/footer pattern