Skip to content

Commit

Permalink
fix: fix index attr for roundable
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Oct 10, 2022
1 parent e72b119 commit 92932d7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-moveable/src/react-moveable/ables/Roundable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 92932d7

Please sign in to comment.