Skip to content

Commit

Permalink
Fix default text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jun 27, 2017
1 parent 44f759a commit 58ec593
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions blocks/alignment-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ALIGNMENT_CONTROLS = [
{
icon: 'editor-alignleft',
title: __( 'Align left' ),
align: 'left',
align: undefined,
},
{
icon: 'editor-aligncenter',
Expand All @@ -32,7 +32,7 @@ export default function AlignmentToolbar( { value, onChange } ) {
return {
...control,
isActive,
onClick: () => onChange( isActive ? null : align ),
onClick: () => onChange( isActive ? undefined : align ),
};
} ) }
/>
Expand Down
2 changes: 1 addition & 1 deletion blocks/library/heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ registerBlockType( 'core/heading', {
content: after,
} ) );
} }
style={ { textAlign: align } }
style={ { textAlign: align || null } }
/>,
];
},
Expand Down
2 changes: 1 addition & 1 deletion blocks/library/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ registerBlockType( 'core/quote', {
focus={ focusedEditable === 'value' ? focus : null }
onFocus={ ( props ) => setFocus( { ...props, editable: 'value' } ) }
onMerge={ mergeBlocks }
style={ { textAlign: align } }
style={ { textAlign: align || null } }
/>
{ ( ( citation && citation.length > 0 ) || !! focus ) && (
<Editable
Expand Down
2 changes: 1 addition & 1 deletion blocks/library/text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ registerBlockType( 'core/text', {
} ) );
} }
onMerge={ mergeBlocks }
style={ { textAlign: align } }
style={ { textAlign: align || null } }
className={ dropCap && 'has-drop-cap' }
placeholder={ __( 'Write…' ) }
/>,
Expand Down

0 comments on commit 58ec593

Please sign in to comment.