mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
Fix list drop (#2996)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
6d98f9e6b6
commit
6bdb599e35
@ -222,12 +222,12 @@
|
||||
ev.stopPropagation()
|
||||
ev.preventDefault()
|
||||
const update: DocumentUpdate<Doc> = {}
|
||||
if (dragItemIndex !== undefined) {
|
||||
if (dragItemIndex !== undefined && viewOptions.orderBy[0] === 'rank') {
|
||||
const prev = limited[dragItemIndex - 1] as DocWithRank
|
||||
const next = limited[dragItemIndex + 1] as DocWithRank
|
||||
try {
|
||||
const newRank = calcRank(prev, next)
|
||||
if ((dragItem as DocWithRank)?.rank !== newRank) {
|
||||
if ((dragItem.doc as DocWithRank)?.rank !== newRank) {
|
||||
;(update as any).rank = newRank
|
||||
}
|
||||
} catch {}
|
||||
@ -241,7 +241,7 @@
|
||||
if (props !== undefined) {
|
||||
for (const key in props) {
|
||||
const value = props[key]
|
||||
if ((dragItem as any)[key] !== value) {
|
||||
if ((dragItem.doc as any)[key] !== value) {
|
||||
;(update as any)[key] = value
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user