Skip to content

The HTML5Backend should determine draggable from canDrag #2909

@anuraags

Description

@anuraags

Is your feature request related to a problem? Please describe.

Currently there is a canDrag predicate that can be assigned to a drag source in react-dnd. However, the HTML5Backend currently sets "draggable" to true for a drag source regardless what this predicate returns. It should actually set the draggable property in this line:

node.setAttribute('draggable', 'true')

based on canDrag from the monitor or options.

This can allow developers to prevent bugs such as this one:
#438

by setting canDrag based on a focus predicate.

Describe the solution you'd like

That when canDrag is false for a drag source, the draggable attribute for that drag source ref is set to false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions