From 092b5f52d79b0bfc97a655d47bc19b9dffb82ad2 Mon Sep 17 00:00:00 2001 From: Alquen Sarmiento Date: Thu, 16 Jan 2025 12:57:53 +0800 Subject: [PATCH] fix(button-group): use "horizontal" instead of falsy "" --- src/block/button-group/edit.js | 4 ++-- src/block/button-group/style.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/block/button-group/edit.js b/src/block/button-group/edit.js index a44a4f46d..941be9163 100644 --- a/src/block/button-group/edit.js +++ b/src/block/button-group/edit.js @@ -77,7 +77,7 @@ const TOOLBAR_ALIGN_OPTIONS = ALIGN_OPTIONS.map( control => { const ALIGNMENT_CONTROLS_DESKTOP = [ { title: __( 'Horizontal', i18n ), - value: '', + value: 'horizontal', }, { title: __( 'Vertical', i18n ), @@ -134,7 +134,7 @@ const Edit = props => { ] ) let contentAlignControls = null - if ( attributes.buttonAlign === '' ) { + if ( attributes.buttonAlign === 'horizontal' ) { contentAlignControls = ALIGN_OPTIONS } if ( deviceType === 'Tablet' || deviceType === 'Mobile' ) { diff --git a/src/block/button-group/style.js b/src/block/button-group/style.js index 7e807f244..a56a6fc33 100644 --- a/src/block/button-group/style.js +++ b/src/block/button-group/style.js @@ -50,9 +50,10 @@ blockStyles.addBlockStyles( 'buttonAlign', [ { valuePreCallback: value => { if ( value === 'vertical' ) { return 'column' + } else if ( value === 'horizontal' ) { + return 'row' } - - return 'row' + return value }, }, { renderIn: 'edit',