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 Jul 26, 2023
1 parent 06c704e commit bdde553
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

1 comment on commit bdde553

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in bdde553.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5665424638
📝 Reported issues:

Please sign in to comment.