Skip to content

Commit

Permalink
List View: Ensure onDrop does not fire if there is no target (#52959)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong authored and ramonjd committed Jul 28, 2023
1 parent 8142681 commit 12fcd6b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,11 @@ export default function useListViewDropZone( { dropZoneElement } ) {

const ref = useDropZone( {
dropZoneElement,
onDrop: onBlockDrop,
onDrop( event ) {
if ( target ) {
onBlockDrop( event );
}
},
onDragLeave() {
throttled.cancel();
setTarget( null );
Expand Down

0 comments on commit 12fcd6b

Please sign in to comment.