mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-30 04:05:39 +00: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.stopPropagation()
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
const update: DocumentUpdate<Doc> = {}
|
const update: DocumentUpdate<Doc> = {}
|
||||||
if (dragItemIndex !== undefined) {
|
if (dragItemIndex !== undefined && viewOptions.orderBy[0] === 'rank') {
|
||||||
const prev = limited[dragItemIndex - 1] as DocWithRank
|
const prev = limited[dragItemIndex - 1] as DocWithRank
|
||||||
const next = limited[dragItemIndex + 1] as DocWithRank
|
const next = limited[dragItemIndex + 1] as DocWithRank
|
||||||
try {
|
try {
|
||||||
const newRank = calcRank(prev, next)
|
const newRank = calcRank(prev, next)
|
||||||
if ((dragItem as DocWithRank)?.rank !== newRank) {
|
if ((dragItem.doc as DocWithRank)?.rank !== newRank) {
|
||||||
;(update as any).rank = newRank
|
;(update as any).rank = newRank
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
@ -241,7 +241,7 @@
|
|||||||
if (props !== undefined) {
|
if (props !== undefined) {
|
||||||
for (const key in props) {
|
for (const key in props) {
|
||||||
const value = props[key]
|
const value = props[key]
|
||||||
if ((dragItem as any)[key] !== value) {
|
if ((dragItem.doc as any)[key] !== value) {
|
||||||
;(update as any)[key] = value
|
;(update as any)[key] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user