Skip to content

Commit

Permalink
Hide content image when lightbox is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiomorales committed Jul 10, 2024
1 parent acda158 commit 5d911ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
// contain a caption, and we don't want to trigger the lightbox when the
// caption is clicked.
$p->set_attribute( 'data-wp-on-async--click', 'actions.showLightbox' );
$p->set_attribute( 'data-wp-class--hide', 'state.overlayOpened' );

$body_content = $p->get_updated_html();

Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
max-width: 100%;
vertical-align: bottom;
box-sizing: border-box;

&.hide {
opacity: 0;
}
}

// The following style maintains border radius application for deprecated
Expand Down

0 comments on commit 5d911ec

Please sign in to comment.