next.jscontent-management-systemsanity

How to enable drag & drop and change order functionality in documents list with sanity 3.41.1 and next js 14.2.3?


I'm not able to enable drag & drop and change order functionality in document list and structureTool.

import { StructureBuilder } from "sanity/structure";

export const dataStructure = (S: StructureBuilder, id: string, title: string) =>
  S.listItem({
    id,
    title,
    child: () =>
      S.documentTypeList("data")
        .title("Data")
        .child((documentId) =>
          S.document()
            .documentId(documentId)
            .schemaType("data")
            .views([S.view.form()])
        )
        .canHandleIntent(() => true)
  });

I've tried .canHandleIntent() method but seems not working.

Next.js - 14.2.3
Sanity - 3.41.1


Solution

  • https://www.sanity.io/plugins/orderable-document-list

    orderableDocumentListDeskItem() works for me in structureTool.