dnd-multi-backend
dnd-multi-backend copied to clipboard
Transition on state changes.
I am tracking is ctrl is pressed using a state in react, I want that the transition happens when the state updates.
Hi @shashtag,
I am not sure I understand. Could you explain in bit more details what you want to achieve and how it relates to dnd-multi-backend
?
We were using react-dnd-html5-backend when we encountered a problem where we could not drop while the CTRL key is pressed.
We tried multiple ways to fix that but none of them worked. Finally we decided to use the touch backend.
We found that touch backend is not as performant as the HTML5Backend
We think if we could change the backend when CTRL is pressed to touch backend, we would be able to keep our functionality as well have the snappiness of HTML5Backend when CTRL is not press.
Which pipeline are you using? rdndmb-html5-to-touch
?
In any case, if you create your own pipeline you can easily customize the events that trigger the switch between HTML5 and Touch. See how the current functions are defined here: https://github.com/LouisBrunner/dnd-multi-backend/blob/main/packages/dnd-multi-backend/src/transitions.ts