Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition on state changes. #283

Open
shashtag opened this issue Apr 16, 2024 · 3 comments
Open

Transition on state changes. #283

shashtag opened this issue Apr 16, 2024 · 3 comments

Comments

@shashtag
Copy link

I am tracking is ctrl is pressed using a state in react, I want that the transition happens when the state updates.

@LouisBrunner
Copy link
Owner

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?

@shashtag
Copy link
Author

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.

@LouisBrunner
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants