react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]
MIT License
145 stars 97 forks source link

dragPreview on a <tr> #21

Closed taylor1791 closed 8 years ago

taylor1791 commented 8 years ago

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

gaearon commented 8 years ago

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 :sweat_smile:

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>
    );
  }