fix:cannot delete control when it is first element #131

pr675
Hufe921 3 years ago
parent b95127c5f0
commit 45ef8b6954

@ -243,7 +243,8 @@ export class Control {
if (nextIndex === elementList.length) { if (nextIndex === elementList.length) {
rightIndex = nextIndex - 1 rightIndex = nextIndex - 1
} }
if (!~leftIndex || !~rightIndex) return startIndex if (!~leftIndex && !~rightIndex) return startIndex
leftIndex = ~leftIndex ? leftIndex : 0
// 删除元素 // 删除元素
elementList.splice(leftIndex + 1, rightIndex - leftIndex) elementList.splice(leftIndex + 1, rightIndex - leftIndex)
return leftIndex return leftIndex

Loading…
Cancel
Save