Skip to content

Conversation

@miguelgrc
Copy link
Contributor

@miguelgrc miguelgrc commented Jun 27, 2024

Closes #50

Swapped react-dnd-html5-backend with react-dnd-multi-backend. The alternatives proposed in #50 are not ideal:

  • Adding the option for users to provide their desired dnd backend is not that simple, since they would need to take care of choosing one or the other depending on the environment, which would usually vary.
  • The alternative of waiting for Make dnd optional #17 to be merged and then disabling it by default for mobile, removing the select field column and having only two columns (the schema tree and the schema preview which would also be used for the property editor) is not ideal as the screen space would be a bit too narrow to have those two columns side by side (it is better to have the schema preview as a full-width column below).

The chosen solution also has its drawbacks (a slightly bigger bundle size) but it's the simplest and maintains the dnd functionality on all devices, which is the most comfortable way of using formule.

Something else that could be done in this direction is to have the dnd dependencies as optional peer dependencies and let users install them only if they want to use the dnd, but this would be trickier to set up.

@@ -1,5 +1,6 @@
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove/replace also in other components. e.g.: src/admin/components/SchemaWizard.jsx

@miguelgrc miguelgrc force-pushed the add-touch-support-for-dnd branch from f92f884 to f0ea621 Compare July 8, 2024 13:28
@pamfilos pamfilos merged commit 9b42323 into cern-sis:master Jul 8, 2024
@miguelgrc miguelgrc deleted the add-touch-support-for-dnd branch August 5, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-dnd doesn't work with touch screens

2 participants