Skip to content

Commit f5738ff

Browse files
authored
fix (button-group): button vertical alignment now working in tablet (#3393)
use "horizontal" instead of falsy ""
1 parent 112b003 commit f5738ff

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/block/button-group/edit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const TOOLBAR_ALIGN_OPTIONS = ALIGN_OPTIONS.map( control => {
7777
const ALIGNMENT_CONTROLS_DESKTOP = [
7878
{
7979
title: __( 'Horizontal', i18n ),
80-
value: '',
80+
value: 'horizontal',
8181
},
8282
{
8383
title: __( 'Vertical', i18n ),
@@ -134,7 +134,7 @@ const Edit = props => {
134134
] )
135135

136136
let contentAlignControls = null
137-
if ( attributes.buttonAlign === '' ) {
137+
if ( attributes.buttonAlign === 'horizontal' ) {
138138
contentAlignControls = ALIGN_OPTIONS
139139
}
140140
if ( deviceType === 'Tablet' || deviceType === 'Mobile' ) {

src/block/button-group/style.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ blockStyles.addBlockStyles( 'buttonAlign', [ {
5050
valuePreCallback: value => {
5151
if ( value === 'vertical' ) {
5252
return 'column'
53+
} else if ( value === 'horizontal' ) {
54+
return 'row'
5355
}
54-
55-
return 'row'
56+
return value
5657
},
5758
}, {
5859
renderIn: 'edit',

0 commit comments

Comments
 (0)