Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix call to handleScroll() and add touch callback to new render method
  • Loading branch information
artemiomorales committed Sep 27, 2023
commit 2f7af76feeace90bbd1cbfc6de350124f6c2b42f
2 changes: 1 addition & 1 deletion packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
aria-modal="false"
data-wp-effect="effects.core.image.initLightbox"
data-wp-on--keydown="actions.core.image.handleKeydown"
data-wp-on--mousewheel="actions.core.image.hideLightbox"
data-wp-on--touchmove="actions.core.image.handleTouchMove"
data-wp-on--click="actions.core.image.hideLightbox"
>
<button type="button" aria-label="$close_button_label" style="fill: $close_button_color" class="close-button" data-wp-on--click="actions.core.image.hideLightbox">
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let scrollCallback;
// behavior. In the future, we may be able to use CSS or overflow: hidden
// instead to not rely on JavaScript, but this seems to be the best approach
// for now that provides the best visual experience.
function handleScroll( event, context, actions ) {
function handleScroll( context, actions, event ) {
event.preventDefault();
window.scrollTo(
context.core.image.lastScrollLeft,
Expand Down