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; + } } }