Skip to content

Commit

Permalink
Fix: Don't render drop zone bellow the default block appender.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Aug 6, 2019
1 parent 0b853e8 commit 359cc36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions packages/block-editor/src/components/block-drop-zone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class BlockDropZone extends Component {
const { clientId, rootClientId, getBlockIndex } = this.props;
if ( clientId !== undefined ) {
const index = getBlockIndex( clientId, rootClientId );
return position.y === 'top' ? index : index + 1;
return ( position && position.y === 'top' ) ? index : index + 1;
}
}

Expand Down Expand Up @@ -111,10 +111,12 @@ class BlockDropZone extends Component {
}

render() {
const { isLockedAll, index } = this.props;
const { isLockedAll } = this.props;
if ( isLockedAll ) {
return null;
}

const index = this.getInsertIndex();
const isAppender = index === undefined;

return (
Expand Down
16 changes: 10 additions & 6 deletions packages/block-editor/src/components/block-drop-zone/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
display: none;
}

&.is-close-to-bottom {
&.is-close-to-bottom,
&.is-close-to-top {
background: none;
border-bottom: 3px solid theme(primary);
}

&.is-close-to-top,
&.is-appender.is-close-to-top,
&.is-appender.is-close-to-bottom {
background: none;
&.is-close-to-top {
border-top: 3px solid theme(primary);
}

&.is-close-to-bottom {
border-bottom: 3px solid theme(primary);
}

&.is-appender.is-active.is-dragging-over-document {
border-bottom: none;
}
}

0 comments on commit 359cc36

Please sign in to comment.