Skip to content

Commit

Permalink
Add Custom Template modal: do not use Composite store (#65044)
Browse files Browse the repository at this point in the history
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored Sep 4, 2024
1 parent ba63b90 commit 0adcec4
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ import { useDebouncedInput } from '@wordpress/compose';
import { unlock } from '../../lock-unlock';
import { mapToIHasNameAndId } from './utils';

const {
CompositeV2: Composite,
CompositeItemV2: CompositeItem,
useCompositeStoreV2: useCompositeStore,
} = unlock( componentsPrivateApis );
const { CompositeV2: Composite, CompositeItemV2: CompositeItem } = unlock(
componentsPrivateApis
);

const EMPTY_ARRAY = [];

Expand Down Expand Up @@ -122,7 +120,6 @@ function useSearchSuggestions( entityForSuggestions, search ) {
}

function SuggestionList( { entityForSuggestions, onSelect } ) {
const composite = useCompositeStore( { orientation: 'vertical' } );
const [ search, setSearch, debouncedSearch ] = useDebouncedInput();
const suggestions = useSearchSuggestions(
entityForSuggestions,
Expand All @@ -146,7 +143,7 @@ function SuggestionList( { entityForSuggestions, onSelect } ) {
) }
{ !! suggestions?.length && (
<Composite
store={ composite }
orientation="vertical"
role="listbox"
className="edit-site-custom-template-modal__suggestions_list"
aria-label={ __( 'Suggestions list' ) }
Expand Down

1 comment on commit 0adcec4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 0adcec4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10703283184
📝 Reported issues:

Please sign in to comment.