Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
List View: Ensure onDrop does not fire if there is no target
  • Loading branch information
andrewserong committed Jul 26, 2023
commit 05d1c750911f7b97b756d0e05f0bf39aee05970c
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