Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable align button on the heading block for Android #21268

Merged
merged 2 commits into from
Mar 31, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/block-library/src/heading/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ function HeadingEdit( { attributes, setAttributes, mergeBlocks, onReplace } ) {
setAttributes( { level: newLevel } )
}
/>
<AlignmentToolbar
value={ align }
onChange={ ( nextAlign ) => {
setAttributes( { align: nextAlign } );
} }
/>
{ Platform.OS !== 'android' && (
Copy link
Contributor

@mchowning mchowning Mar 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't working for me (I still see the alignment buttons on Android). I think because this is our re-exported Platform and not the react-native Platform. I'm seeing Platform.OS with a value of native. Do we have to use Platform.select here?

<AlignmentToolbar
value={ align }
onChange={ ( nextAlign ) => {
setAttributes( { align: nextAlign } );
} }
/>
) }
</BlockControls>
{ Platform.OS === 'web' && (
<InspectorControls>
Expand Down