Skip to content

Commit

Permalink
Update the comment in Search block to clarify when Instant Search is …
Browse files Browse the repository at this point in the history
…enabled
  • Loading branch information
michalczaplinski committed Dec 12, 2024
1 parent 95a9647 commit ac750ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ function render_block_core_search( $attributes, $content, $block ) {
$input->set_attribute( 'tabindex', '-1' );
}

// Instant search is only available when using the enhanced pagination.
// Instant search is only enabled when both are true:
// 1. The block is a child of a Query Loop block.
// 2. The Query Loop block has the enhanced pagination feature enabled.
//
// Instant search functionality does not make sense without enhanced pagination
// because we might have to paginate the results of the search too!
if ( $enhanced_pagination ) {
wp_enqueue_script_module( '@wordpress/block-library/search/view' );

Expand Down

0 comments on commit ac750ae

Please sign in to comment.