Permalink
Browse files

Gallery: deselect images when. losing focus. (#4330)

  • Loading branch information...
jorgefilipecosta committed Jan 8, 2018
1 parent 08e8394 commit 03a42f04b38c4ab2f98a713f8cd41fc85a592012
Showing with 9 additions and 0 deletions.
  1. +9 −0 blocks/library/gallery/block.js
@@ -127,6 +127,15 @@ class GalleryBlock extends Component {
);
}
componentWillReceiveProps( nextProps ) {
// Deselect images when losing focus
if ( ! nextProps.focus && this.props.focus ) {
this.setState( {
selectedImage: null,
} );
}
}
render() {
const { attributes, focus, className } = this.props;
const { images, columns = defaultColumnsNumber( attributes ), align, imageCrop, linkTo } = attributes;

0 comments on commit 03a42f0

Please sign in to comment.