Skip to content

Commit

Permalink
Avoid setting alignSelf for image placeholders (#18793)
Browse files Browse the repository at this point in the history
This was causing the placeholders to not display
  • Loading branch information
mchowning authored Dec 17, 2019
1 parent fedda9f commit 30483ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ export class ImageEdit extends React.Component {
);

return (
<View style={ { flex: 1, alignSelf: alignToFlex[ align ] } } >
<View style={ {
flex: 1,
// only set alignSelf if an image exists because alignSelf causes the placeholder
// to disappear when an aligned image can't be downloaded
// https://github.com/wordpress-mobile/gutenberg-mobile/issues/1592
alignSelf: imageWidthWithinContainer && alignToFlex[ align ] }
} >
{ ! imageWidthWithinContainer &&
<View style={ [ styles.imageContainer, { height: imageContainerHeight } ] } >
{ this.getIcon( false ) }
Expand Down

0 comments on commit 30483ce

Please sign in to comment.