Skip to content

Commit

Permalink
Patterns: Fix category control width in site editor (#54853)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored Sep 27, 2023
1 parent 4be4d55 commit b5c8d2d
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __, _x, sprintf } from '@wordpress/i18n';
import { useEffect, useMemo, useState } from '@wordpress/element';
import { FormTokenField, PanelRow } from '@wordpress/components';
import { FormTokenField, FlexBlock, PanelRow } from '@wordpress/components';
import { useSelect, useDispatch } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { useDebounce } from '@wordpress/compose';
Expand Down Expand Up @@ -257,21 +257,23 @@ export default function PatternCategories( { post } ) {

return (
<PanelRow initialOpen={ true } title={ __( 'Categories' ) }>
<FormTokenField
__next40pxDefaultSize
value={ values }
suggestions={ suggestions }
onChange={ onChange }
onInputChange={ debouncedSearch }
maxSuggestions={ MAX_TERMS_SUGGESTIONS }
label={ __( 'Pattern categories' ) }
messages={ {
added: termAddedLabel,
removed: termRemovedLabel,
remove: removeTermLabel,
} }
tokenizeOnBlur
/>
<FlexBlock>
<FormTokenField
__next40pxDefaultSize
value={ values }
suggestions={ suggestions }
onChange={ onChange }
onInputChange={ debouncedSearch }
maxSuggestions={ MAX_TERMS_SUGGESTIONS }
label={ __( 'Pattern categories' ) }
messages={ {
added: termAddedLabel,
removed: termRemovedLabel,
remove: removeTermLabel,
} }
tokenizeOnBlur
/>
</FlexBlock>
</PanelRow>
);
}

0 comments on commit b5c8d2d

Please sign in to comment.