Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/TermSearchControl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ const getTermIdByTermValue = ( terms, termValue ) => {
* @param {object} props.taxonomy The taxonomy object.
* @param {number[]} props.termIds An array with the block's term ids for the given taxonomy.
* @param {Function} props.onChange Callback `onChange` function.
* @param {number} props.perPage A number to use for the search terms per page.
*
* @returns {Element} The rendered component.
*/
function TermSearchControl( { label, taxonomy, termIds, onChange } ) {
function TermSearchControl( { label, taxonomy, termIds, onChange, perPage = 20 } ) {
const [ search, setSearch ] = useState( '' );
const [ value, setValue ] = useState( EMPTY_ARRAY );
const [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY );
Expand Down Expand Up @@ -83,7 +84,7 @@ function TermSearchControl( { label, taxonomy, termIds, onChange } ) {
search,
orderby: 'name',
exclude: termIds,
per_page: 20,
per_page: perPage,
},
];
return {
Expand Down
Loading