CYS: Fix pattern rendering issues (#49041)

* CYS: Fix pattern rendering issues

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

* fix import

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Luigi Teschio 2024-07-03 09:25:12 +02:00 committed by GitHub
parent 60c4807e4b
commit 7b3434c8b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import {
useRef,
useState,
} from '@wordpress/element';
import { useAsyncList } from '@wordpress/compose';
import { useSelect, useDispatch, select } from '@wordpress/data';
import { BlockInstance, cloneBlock } from '@wordpress/blocks';
import { close } from '@wordpress/icons';
@ -108,6 +109,8 @@ export const SidebarPatternScreen = ( { category }: { category: string } ) => {
);
}, [ category, patterns ] );
const asyncSortedPatterns = useAsyncList( sortedPatterns );
const [ patternPagination, setPatternPagination ] = useState( 10 );
const refElement = useRef< HTMLDivElement >( null );
@ -243,11 +246,11 @@ export const SidebarPatternScreen = ( { category }: { category: string } ) => {
) }
{ ! isSpinnerVisible && (
<BlockPatternList
shownPatterns={ sortedPatterns.slice(
shownPatterns={ asyncSortedPatterns.slice(
0,
patternPagination
) }
blockPatterns={ sortedPatterns.slice(
blockPatterns={ asyncSortedPatterns.slice(
0,
patternPagination
) }

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
CYS: Fix pattern rendering issues