Fix missing check for sort field (#19412)

Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
Nitwel
2023-08-14 11:32:55 +02:00
committed by GitHub
parent 772bc2ac37
commit 8b91e7cd05
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@directus/app": patch
---
Fixed saving/updating in Kanban-Layout with missing Sort-Field

View File

@@ -279,7 +279,7 @@ export default defineLayout<LayoutOptions, LayoutQuery>({
const before = group.items[event.added.newIndex - 1] as Item | undefined;
const after = group.items[event.added.newIndex] as Item | undefined;
if (item.sort !== undefined) {
if (item.sort !== undefined && sortField.value) {
if (after?.sort !== undefined && after.sort < item.sort) {
await changeManualSort({ item: item.id, to: after.id });
} else if (before?.sort !== undefined && before.sort > item.sort) {