Browse Source
Merge branch 'dev' into fix/6096-bug-resizable-box-disappears-on-component-reselection
pull/6128/head
Artur Arseniev
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
8 additions and
1 deletions
-
packages/core/src/utils/Sorter.ts
|
|
|
@ -697,7 +697,14 @@ export default class Sorter extends View { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
const index = pos ? (pos.method === 'after' ? pos.indexEl + 1 : pos.indexEl) : trgModel.components().length; |
|
|
|
let length = -1; |
|
|
|
const isCollection = trgModel instanceof Collection; |
|
|
|
if (isFunction(trgModel.components)) { |
|
|
|
length = trgModel.components().length; |
|
|
|
} else if (isCollection) { |
|
|
|
length = trgModel.models.length; |
|
|
|
} |
|
|
|
const index = pos ? (pos.method === 'after' ? pos.indexEl + 1 : pos.indexEl) : length; |
|
|
|
|
|
|
|
// Check if the source is draggable in target
|
|
|
|
let draggable = srcModel.get('draggable'); |
|
|
|
|