dnd-multi-backend icon indicating copy to clipboard operation
dnd-multi-backend copied to clipboard

Determine which backend is currently in use

Open dotmlj opened this issue 4 years ago • 1 comments

[email protected]

Is there a way to determine which backend is currently in use, so the layout and functionality of the Preview can be altered based on this?

Thanks

dotmlj avatar Sep 14 '21 12:09 dotmlj

Hi @dotmlj,

Would passing this information as part of usePreview's result or Preview's props be enough?

LouisBrunner avatar Aug 31 '22 16:08 LouisBrunner

We actually have a different use case for knowing the backend, which is we want to have some places where touch is not supported for drag and drop, but others where it is supported. In this case passing it to the preview wouldn't do the trick.

dobesv avatar Sep 28 '22 03:09 dobesv

Using useMultiDrag (and it's drop equivalent), you can explicitly decide which part can be use to drag with Touch, HTML5, etc

https://github.com/LouisBrunner/dnd-multi-backend/tree/main/packages/react-dnd-multi-backend#usemultidrag

LouisBrunner avatar Sep 28 '22 11:09 LouisBrunner

Nice, thanks!

dobesv avatar Sep 28 '22 17:09 dobesv

@dotmlj As there is a mechanism to do this behaviour, I will be closing this issue. Feel free to reopen if useMultiDrag doesn't work for you.

LouisBrunner avatar Dec 10 '22 17:12 LouisBrunner