MaxLeiter / MaxLeiter/sortablejs-vue3

Custom delete events do not work

Open
#44 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vue
Stars
413
Forks
27
PR merge metrics
No merged PRs in 30d

Description

 <Sortable :list="taskList" class="table-wrapper-web" item-key="id" tag="div" :options="options" @add="addEntry"
            @update="moveEntryWithinList" @remove="removeNestedEntry">
            <template #item="{ element }">
                <div :data-parent-id="parentId" :data-entry-id="element.id" :data-entry-type="element.type" class="drawing-item">

                    <span class="drawing-item-copy" :class="[element.id == select ? 'drawing-row-item' : '']"
                        @click.stop="handleCopyItem(element)">
                        <icon :size="14">
                            <CopyDocument />
                        </icon>
                    </span>

                    <span class="drawing-item-delete" :class="[element.id == select ? 'drawing-row-item' : '']"
                        @click.stop="handleDeleteItem(element)">
                        <icon :size="14">
                            <Delete />
                        </icon>
                    </span>

                </div>
            </template>
        </Sortable>

const options = ref({
    handle: '.drawing-item',
    group: 'desgin',
    animation: 100,
    forceFallback: true,
    fallbackOnBody: true,
    ghostClass: "sortable-ghost"
})

Clicking the delete event inside the item does not respond, but fires the ghost event

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided example with the shown options, especially forceFallback and the item-level delete click handler. Trace the wrapper's event handling to determine why the click does not invoke the custom delete event and instead triggers the ghost event. Done means the delete control responds with the expected custom event without triggering the ghost behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.