From 9dd3ac8443b9b8e1c1ee90c1a74d16dedf325f00 Mon Sep 17 00:00:00 2001 From: Tung Du Date: Fri, 6 May 2022 18:05:54 +0700 Subject: [PATCH] Fix: Empty Mini Cart Contents view in editor is not vertically centered on WP 6.0 (#6379) --- assets/js/blocks/mini-cart/mini-cart-contents/editor.scss | 4 +++- .../inner-blocks/empty-mini-cart-contents-block/frontend.tsx | 4 +++- assets/js/blocks/mini-cart/style.scss | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss b/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss index c445da95090..4d0ac1f59c3 100644 --- a/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss +++ b/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss @@ -55,19 +55,21 @@ } .wp-block-woocommerce-empty-mini-cart-contents-block { + min-height: 100vh; overflow-y: unset; padding: 0; > .block-editor-inner-blocks { + box-sizing: border-box; max-height: 100vh; overflow-y: auto; - box-sizing: border-box; padding: $gap-largest $gap $gap; } // Temporary fix after the appender button was positioned absolute // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168 .block-list-appender { + margin-top: $gap; position: relative; } diff --git a/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx b/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx index 46e82f36c4e..66683fe9aeb 100644 --- a/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx +++ b/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx @@ -33,7 +33,9 @@ const EmptyMiniCartContentsBlock = ( { return (
- { children } +
+ { children } +
); }; diff --git a/assets/js/blocks/mini-cart/style.scss b/assets/js/blocks/mini-cart/style.scss index 13dc54272f4..eadee63993f 100644 --- a/assets/js/blocks/mini-cart/style.scss +++ b/assets/js/blocks/mini-cart/style.scss @@ -84,7 +84,7 @@ justify-content: space-between; } -.wp-block-woocommerce-empty-mini-cart-contents-block { +.wp-block-woocommerce-empty-mini-cart-contents-block .wc-block-mini-cart__empty-cart-wrapper { overflow-y: auto; padding: $gap-largest $gap $gap; }