react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dragPreview on a <tr>

taylor1791 opened this issue · comments

Using dragPreview on a <tr> does not create a drag image in chrome. This is because of a bug in chromium. Should react-dnd-html5-backend work around this "quirk"?

Example: In this example the + sign is the dragSource, while the whole row is the dragPreview. Notice that there is no drag image when you try to drag it.

http://jsbin.com/kidoyu/2/edit?js,output

commented

Thanks for reporting!

Should react-dnd-html5-backend work around this "quirk"?

I’m afraid this isn’t something that would be easy to work around.
Can’t fix all the quirks 😅

The closest alternative I can offer you is

  render() {
    return (
      <tr>
        <td>{this.props.dragSource(<span>+</span>)}</td>
        <td>{this.props.dragPreview(<span>{this.props.data.value}</span>)}</td>
      </tr>
    );
  }