react-dnd / react-dnd-html5-backend

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

In Safari, cannot preserve appearance of link while dragging #11

Closed gaearon closed 8 years ago

gaearon commented 8 years ago

Moved from https://github.com/gaearon/react-dnd/issues/341. Original issue by @ceguster


I am trying to preserve the appearance of a div containing an tag while dragging it. In Chrome and Firefox, I have no trouble, but in Safari, when I begin dragging the element, its appearance changes to the native browser implementation of a dragged link.

I verified the discrepancy in Safari by cloning your repo and changing the markup in react-dnd/examples/02 Drag Around/Naive/Box.js to include an tag (see diff below).

Even with that change, Chrome and Firefox are still able to show the original image while dragging.

Running OS X Yosemite (10.10.5) Browsers:

  • Safari: 9.0.1 (10601.2.7.2)
  • Chrome: 46.0.2490.86 (64-bit)
  • Firefox: 42.0
react-dnd-safari-link-drag-diff
gaearon commented 8 years ago

I looked at this, and I don't think we can work around it. Safari just chooses to ignore the drag image we set in this case. I'd suggest replacing <a> with a custom <Link> component that behaves similarly but doesn't use <a>. Closing as wontfix because apparently we can't.