From 5ea9fc362534e8a56976ad87053700ee06a14e0d Mon Sep 17 00:00:00 2001 From: Daybrush Date: Thu, 11 Aug 2022 22:34:30 +0900 Subject: [PATCH] fix: fix that dragStart method cannot fire #718 --- packages/moveable/src/consts.ts | 8 ++++++-- .../react-moveable/src/react-moveable/ables/Draggable.tsx | 3 ++- .../react-moveable/src/react-moveable/ables/Resizable.ts | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/moveable/src/consts.ts b/packages/moveable/src/consts.ts index 58b9bc85f..cc0b77061 100644 --- a/packages/moveable/src/consts.ts +++ b/packages/moveable/src/consts.ts @@ -1,5 +1,9 @@ -import { MOVEABLE_PROPS_MAP } from "react-compat-moveable"; -import { MOVEABLE_PROPS, MOVEABLE_METHODS, MOVEABLE_EVENTS } from "react-moveable"; +import { + MOVEABLE_PROPS_MAP, + MOVEABLE_PROPS, + MOVEABLE_METHODS, + MOVEABLE_EVENTS, +} from "react-moveable"; export const PROPERTIES: string[] = MOVEABLE_PROPS; export const METHODS: string[] = MOVEABLE_METHODS; diff --git a/packages/react-moveable/src/react-moveable/ables/Draggable.tsx b/packages/react-moveable/src/react-moveable/ables/Draggable.tsx index 7b82f713f..b4e59c424 100644 --- a/packages/react-moveable/src/react-moveable/ables/Draggable.tsx +++ b/packages/react-moveable/src/react-moveable/ables/Draggable.tsx @@ -408,7 +408,8 @@ export default { }, }; }, - unset(moveable: any) { + unset(moveable: MoveableManagerInterface>) { + moveable.state.gestos.draggable = null; moveable.state.dragInfo = null; }, }; diff --git a/packages/react-moveable/src/react-moveable/ables/Resizable.ts b/packages/react-moveable/src/react-moveable/ables/Resizable.ts index e49ff4110..815dfaf7d 100644 --- a/packages/react-moveable/src/react-moveable/ables/Resizable.ts +++ b/packages/react-moveable/src/react-moveable/ables/Resizable.ts @@ -792,6 +792,9 @@ export default { }, }; }, + unset(moveable: MoveableManagerInterface) { + moveable.state.gestos.resizable = null; + }, }; /**