Skip to content

Commit

Permalink
Dont bind event handler if images is first/last in sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Apr 11, 2019
1 parent 50172ee commit 63e0bf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/gallery/gallery-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ class GalleryImage extends Component {
<div className="block-library-gallery-item__move-menu">
<IconButton
icon="arrow-left"
onClick={ onMoveBackward }
onClick={ isFirstItem ? undefined : onMoveBackward }
className="blocks-gallery-item__move-backward"
label={ __( 'Move Image Backward' ) }
aria-disabled={ isFirstItem }
/>
<IconButton
icon="arrow-right"
onClick={ onMoveForward }
onClick={ isLastItem ? undefined : onMoveForward }
className="blocks-gallery-item__move-forward"
label={ __( 'Move Image Forward' ) }
aria-disabled={ isLastItem }
Expand Down

0 comments on commit 63e0bf0

Please sign in to comment.