From 92932d7c35f58d365d2b2294d4735fced9416214 Mon Sep 17 00:00:00 2001 From: Daybrush Date: Tue, 11 Oct 2022 03:20:04 +0900 Subject: [PATCH] fix: fix index attr for roundable --- .../src/react-moveable/ables/Roundable.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/react-moveable/src/react-moveable/ables/Roundable.tsx b/packages/react-moveable/src/react-moveable/ables/Roundable.tsx index 3597e3925..c1f792893 100644 --- a/packages/react-moveable/src/react-moveable/ables/Roundable.tsx +++ b/packages/react-moveable/src/react-moveable/ables/Roundable.tsx @@ -240,12 +240,14 @@ export default { let lineIndex = -1; if (isLine) { - const indexAttr = inputTarget.getAttribute("data-line-index")!; + const indexAttr = inputTarget.getAttribute("data-line-key")! || ""; - lineIndex = parseInt(indexAttr.replace(/render-line-/g, ""), 10); + if (indexAttr) { + lineIndex = parseInt(indexAttr.replace(/render-line-/g, ""), 10); - if (isNaN(lineIndex)) { - lineIndex = -1; + if (isNaN(lineIndex)) { + lineIndex = -1; + } } }