From f92f8842efbd5b35e6effbbc42c9e876f26db333 Mon Sep 17 00:00:00 2001 From: Miguel Garcia Garcia Date: Thu, 27 Jun 2024 17:39:30 +0200 Subject: [PATCH] feat(form): add touch screen support for dnd --- package.json | 3 ++- src/exposed.tsx | 9 +++++++-- yarn.lock | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 27a1d9d..8531415 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,9 @@ "markdown-it-texmath": "^1.0.0", "marked": "^9.0.3", "object-path": "^0.11.8", + "rdndmb-html5-to-touch": "^8.0.3", "react-dnd": "^16.0.1", - "react-dnd-html5-backend": "^16.0.1", + "react-dnd-multi-backend": "^8.0.3", "react-input-mask": "3.0.0-alpha.2", "react-markdown-editor-lite": "^1.3.4", "react-redux": "^8.1.2", diff --git a/src/exposed.tsx b/src/exposed.tsx index 015d378..1cad91e 100644 --- a/src/exposed.tsx +++ b/src/exposed.tsx @@ -1,5 +1,6 @@ import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; +import { MultiBackend } from "react-dnd-multi-backend"; +import { HTML5toTouch } from "rdndmb-html5-to-touch"; import { initSchemaStructure, combineFieldTypes } from "./admin/utils"; import CustomizationContext from "./contexts/CustomizationContext"; import { ConfigProvider, ThemeConfig } from "antd"; @@ -41,7 +42,11 @@ export const FormuleContext = ({ {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} {/* @ts-ignore */} - +