fix:cannot delete control when it is first element #131
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user