sanity icon indicating copy to clipboard operation
sanity copied to clipboard

References are not draggable in an array with other types on Sanity V3 in Next.js app

Open jasonbarone opened this issue 3 years ago • 3 comments

Describe the bug

Reference types are not draggable when they're inside of an array with other types on Sanity V3 in Next.js app.

To Reproduce

Steps to reproduce the behavior:

  1. Use Sanity Studio v3 in a Next.js app
  2. Create a Sanity schema that contains an array type:
export const Modules = {
  name: "modules",
  type: "array",
  title: "Modules",
  of: [

    { type: "module-test" },
    { type: "module-another-test" },
    {
      name: "shared-module",
      title: "Shared Module",
      type: "reference",
      to: [{ type: "shared-module" }],
    },
  ],
};

export default Modules;

  1. Place this array into a document schema.
  2. The reference type will not be draggable..

Expected behavior

Reference types should be draggable like the others.

Screenshots Screen Shot 2022-06-22 at 12 45 01 AM Screen Shot 2022-06-22 at 12 45 11 AM

First image is Sanity Studio V2. In the last image, the reference will not display the draggable indicator and will not be draggable.

Which versions of Sanity are you using?

"sanity": "^3.0.0-dev-preview.9",

What operating system are you using?

MacOS latest.

Which versions of Node.js / npm are you running?

node 16.13.1 npm 8.1.2

jasonbarone avatar Jun 22 '22 05:06 jasonbarone

I’m having the same issue. I Just wanted to add that the UI looks a bit off for reference items (white-space, border).

fabien avatar Jul 04 '22 04:07 fabien

I'm still experiencing the same behavior when using array of references

xanderjl avatar Sep 14 '22 17:09 xanderjl

I'm having this issue as well and I just have an array of references to one type of reference not even multiple types.

  {
      name: 'categories',
      title: 'Category',
      type: 'array',
      of: [
        {
          type: 'reference',
          to: [
            {
              type: 'templateCategory',
            },
          ],
        },
      ],
    },
Screen Shot 2022-09-16 at 10 02 36 PM

jaydanurwin avatar Sep 17 '22 04:09 jaydanurwin

This should be fixed in the latest rc.

bjoerge avatar Nov 21 '22 09:11 bjoerge