Skip to content

Commit

Permalink
Load search view script with defer loading strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jul 11, 2023
1 parent 23b7aad commit aefd67a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function render_block_core_search( $attributes ) {
$input->set_attribute( 'aria-hidden', 'true' );
$input->set_attribute( 'tabindex', '-1' );
wp_enqueue_script( 'wp-block--search-view', plugins_url( 'search/view.min.js', __FILE__ ) );
wp_script_add_data( 'wp-block--search-view', 'strategy', 'defer' );
}
}

Expand Down

0 comments on commit aefd67a

Please sign in to comment.