Skip to content

Allow disabling drag or drop on a single gridlist itemΒ #5704

Open
@GermanJablo

Description

@GermanJablo

Provide a general summary of the feature here

As the title says, allow disabling drag or drop on a single gridlist item.

I saw the disabledBehavior property, but if I disable drag for an item I also disable selection, and I don't want that.

Another idea I had is to filter it out the item to deactivate in the getItems function that I pass to useDragAndDrop.
With this, although I get the dragEvent to have no content or data to drag, I can still drag the item.
In other words, data-drop-target, react-aria-DropIndicator and renderDragPreview still appear.

I know that in renderDragPreview I could return an empty div for example, but the mouse would still show that something is being dragged, and the drop-target/indicator still activates.

πŸ€” Expected Behavior?

Allow disabling drag or drop on a single gridlist item

😯 Current Behavior

It is not possible to disable drag or drop on a single gridlist item

πŸ’ Possible Solution

No response

πŸ”¦ Context

a little context about my use case, because I think it may be helpful.

I'm trying to fake a Tree with a gridlist (turning the nesting level into an indent).

image

The Home element has some peculiarities:

❌ I don't want it to be draggable.
❌ I don't want to be able to drop "before" or "after" it (onReorder).
βœ… I want it to be able to drop "inside" it (onItemDrop).

Note: this issue come from this discussion: #5697 (reply in thread)

πŸ’» Examples

No response

🧒 Your Company/Team

No response

πŸ•· Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions