英文:
Drop event not firing in dynamic list - Svelte
问题
以下是您要翻译的内容:
"I have a dynamic list of contenteditables rendered in Svelte and want to be able to drag them to resort them but on:drop or on:dragover both don't seem to be firing. I was thinking it was because it thinks I am trying to drop it on the children elements but if I move those events to a child it still doesn't fire or show the correct cursor.
<div
on:dragover|preventDefault={handleDragOver}
on:dragenter|preventDefault={handleDragEnter}
on:drop={handleDrop}
>
<div
on:dragstart={handleDragStart}
on:dragend={handleDragEnd}
draggable="true"
>
/* Child div here that looks like list bullet (where I want the user to hover to begin dragging */
/* contenteditable div here */
</div>
</div>
There is nothing actually happening in the functions each event is calling except a console.log() to see if it is firing. The events on the draggable div fire fine, but on the parent div I want it to drop to no events are fired. What am I missing?
Thanks in advance"
英文:
I have a dynamic list of contenteditables rendered in Svelte and want to be able to drag them to resort them but on:drop or on:dragover both don't seem to be firing. I was thinking it was because it thinks I am trying to drop it on the children elements but if I move those events to a child it still doesn't fire or show the correct cursor.
<div
on:dragover|preventDefault={handleDragOver}
on:dragenter|preventDefault={handleDragEnter}
on:drop={handleDrop}
>
<div
on:dragstart={handleDragStart}
on:dragend={handleDragEnd}
draggable="true"
>
/* Child div here that looks like list bullet (where I want the user to hover to begin dragging */
/* contenteditable div here */
</div>
</div>
There is nothing actually happening in the functions each event is calling except a console.log() to see if it is firing. The events on the draggable div fire fine, but on the parent div I want it to drop to no events are fired. What am I missing?
Thanks in advance
答案1
得分: 1
在这种情况下的问题是Tauri。我需要在tauri.conf.json文件中的"windows"下将fileDropEnabled设置为false。
英文:
The problem in this case was Tauri. I needed to set fileDropEnabled to false in tauri.conf.json under "windows".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论