Skip to content

error with item-key: componentStructure.js:3 Uncaught TypeError: Cannot set properties of null (setting '__draggable_context') #159

Open
@timothymarois

Description

@timothymarois

Adding item-key="id" doesnt work, it throws this error:

componentStructure.js:3 Uncaught TypeError: Cannot set properties of null (setting '__draggable_context')

When you omit the item key it throws a warning that you need to include the item key prop. So its a catch-22. The items in my case have id property, but using that here, like in the examples on this repo, it doesn't work.

As an example to what I'm using:

<draggable 
                        v-model="myArray" 
                        class="flex justify-start align-middle items-center"
                        tag="transition-group" 
                        v-bind="dragOptions"
                        @start="drag=true" 
                        @end="drag=false" 
                        @change="log"
                        item-key="id"
                        :component-data="{
                            tag: 'ul',
                            name: 'flip-list',
                            type: 'transition'
                        }"
                    >
                            <template #item="{element}">
                                <li class="list-group-item" :key="element.id">
                                    <div class="draggable-grid__item" style="transform: translate3d(0px, 0px, 0px) scale(1);">
                                        <div class="site-box" title="">
                                            <a class="site-box__link">
                                                <div class="site-box__icon shadow">
                                                    <div class="site-box__icon-image" :style="`background-image: url('${element.icon}');`"></div>
                                                </div>
                                                <div class="site-box__label" contenteditable="false">{{ element.name }}</div>
                                            </a>
                                        </div>
                                    </div>
                                </li>
                            </template>
                        </draggable>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions