[feature request] Drop onto another widget

Author: dkozarCreated Feb 28, 2024Updated Aug 4, 2026
Labelsenhancementneeds-info

Describe the bug

When dragging a new item from from outside (see https://react-grid-layout.github.io/react-grid-layout/examples/15-drag-from-outside.html), other items move away, so you always drop the item into the blank space. This is fine.

However, I'd like to have the option of some widgets not moving away. Instead, they'd accept drop of the item from the outside onto them.

For example, this would be used when you want to replace an item in place.

This effect would happen only if the dragged item, and the one I'm dropping on, are marked with some sort of identifier. Or possibly, some sort of callback (returning boolean) could be in place (shouldItemAcceptDrop or similar).

Thanks,

Your Example Website or App

Steps to Reproduce the Bug or Issue

Expected behavior

As a user, I'd like to drag and drop a new widget from the outside, but onto another widget.

react-grid-layout library version

Latest

Operating System Version

MacOS

Browser

Chrome

Additional context

No response

Screenshots or Videos

No response

Source: react-grid-layout/react-grid-layout