Skip to content

Commit 6dd8ed5

Browse files
docs: update docs
1 parent 919e5c0 commit 6dd8ed5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/block-library/src/image/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
211211
$p->set_attribute( 'data-wp-on-async--load', 'callbacks.setButtonStyles' );
212212
$p->set_attribute( 'data-wp-on-async-window--resize', 'callbacks.setButtonStyles' );
213213
// Set an event to prefetch the image on pointerenter and pointerdown(mobile).
214+
// Pointerleave is used to cancel the prefetch if the user hovers away from the image
215+
// before the predefined delay.
214216
$p->set_attribute( 'data-wp-on--pointerenter', 'actions.prefetchImageWithDelay' );
215217
$p->set_attribute( 'data-wp-on--pointerdown', 'actions.prefetchImage' );
216218
$p->set_attribute( 'data-wp-on--pointerleave', 'actions.cancelPrefetch' );

packages/block-library/src/image/view.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ const { state, actions, callbacks } = store(
226226
imageLink.as = 'image';
227227
imageLink.href = uploadedSrc;
228228

229-
// Appends the link element to start the prefetch.
230229
document.head.appendChild( imageLink );
231230
},
232231
prefetchImageWithDelay() {

0 commit comments

Comments
 (0)