Hellenic / react-hexgrid

Build interactive hexagon grids with React
https://hellenic.github.io/react-hexgrid/examples/
MIT License
314 stars 128 forks source link

Patch to make dnd work in firefox. #70

Open LeifAndersen opened 2 years ago

LeifAndersen commented 2 years ago

NOTE: This patch is "not" ready to merge, I made this PR as a request for comments/improvements.

It seems like in firefox, svg elements will not have their onDragStart function called. They will, however have their onMouseDown function called. This patch adds a onMouseDown callback, but it also nulls the data stored in the dragging event. Since onMouseDown doesn't seem to let you add information to the drag store, I suspect a shadow store would need to be created in the component's react state.

jannikbuschke commented 2 years ago

@LeifAndersen I released a new version 2.0.0-beta.2 of this library. Can you check if the issue persists?