From 9901deb3dd51f449edcd75e4f147b9fa671d951e Mon Sep 17 00:00:00 2001 From: Daybrush Date: Fri, 22 Jul 2022 02:25:15 +0900 Subject: [PATCH] feat: add move cursor style with edgeDraggable #703 --- .../src/react-moveable/ables/edgeDraggable.tsx | 5 +++++ .../react-moveable/src/react-moveable/renderDirections.tsx | 3 ++- .../9-Clippable/ReactClippableResizableKeepRatioApp.tsx | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-moveable/src/react-moveable/ables/edgeDraggable.tsx b/packages/react-moveable/src/react-moveable/ables/edgeDraggable.tsx index 42ced0073..6c8529f61 100644 --- a/packages/react-moveable/src/react-moveable/ables/edgeDraggable.tsx +++ b/packages/react-moveable/src/react-moveable/ables/edgeDraggable.tsx @@ -13,6 +13,11 @@ function getDraggableEvent(e: any) { return { ...e, datas }; } export default makeAble("edgeDraggable", { + css: [ + `:host[data-able-edgedraggable] .direction.line:not(.edge) { + cursor: move; +}`, + ], dragControlCondition(moveable: MoveableManagerInterface, e: any) { if (!moveable.props.edgeDraggable || !e.inputEvent) { return false; diff --git a/packages/react-moveable/src/react-moveable/renderDirections.tsx b/packages/react-moveable/src/react-moveable/renderDirections.tsx index 72cc404c6..db1c12d97 100644 --- a/packages/react-moveable/src/react-moveable/renderDirections.tsx +++ b/packages/react-moveable/src/react-moveable/renderDirections.tsx @@ -47,7 +47,8 @@ export function renderDirectionControls( }); } export function renderLine( - React: Renderer, direction: string, + React: Renderer, + direction: string, pos1: number[], pos2: number[], zoom: number, key: number | string, ...classNames: string[]) { diff --git a/packages/react-moveable/stories/5A-Advanced/9-Clippable/ReactClippableResizableKeepRatioApp.tsx b/packages/react-moveable/stories/5A-Advanced/9-Clippable/ReactClippableResizableKeepRatioApp.tsx index dff3c167c..f85d50e21 100644 --- a/packages/react-moveable/stories/5A-Advanced/9-Clippable/ReactClippableResizableKeepRatioApp.tsx +++ b/packages/react-moveable/stories/5A-Advanced/9-Clippable/ReactClippableResizableKeepRatioApp.tsx @@ -26,7 +26,6 @@ export default function App() { e.target.style.transform = e.transform; }} onResize={e => { - console.log(e.width); e.target.style.width = `${e.width}px`; e.target.style.height = `${e.height}px`; e.target.style.transform = e.drag.transform;