fix: cursor blocking ghost text content during dragging

This commit is contained in:
Phan An 2022-12-29 22:05:58 +01:00
parent f360207e94
commit c24cc1c3ed
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
3 changed files with 10 additions and 4 deletions

View file

@ -58,7 +58,6 @@ const onDragOver = (event: DragEvent) => {
if (!acceptsDrop(event)) return false
event.preventDefault()
event.dataTransfer!.dropEffect = 'move'
droppable.value = true
opened.value = true
}
@ -84,7 +83,6 @@ const onDragOverHatch = (event: DragEvent) => {
if (!acceptsDrop(event)) return false
event.preventDefault()
event.dataTransfer!.dropEffect = 'move'
droppableOnHatch.value = true
}

View file

@ -97,7 +97,14 @@ import { faCaretDown, faCaretUp } from '@fortawesome/free-solid-svg-icons'
import { computed, nextTick, onMounted, Ref, ref, watch } from 'vue'
import { eventBus, requireInjection } from '@/utils'
import { useDraggable, useDroppable } from '@/composables'
import { SelectedSongsKey, SongListConfigKey, SongListFilterKeywordsKey, SongListSortFieldKey, SongListSortOrderKey, SongsKey } from '@/symbols'
import {
SelectedSongsKey,
SongListConfigKey,
SongListFilterKeywordsKey,
SongListSortFieldKey,
SongListSortOrderKey,
SongsKey
} from '@/symbols'
import VirtualScroller from '@/components/ui/VirtualScroller.vue'
import SongListItem from '@/components/song/SongListItem.vue'
@ -274,7 +281,6 @@ const onDragEnter = (event: DragEvent) => {
if (acceptsDrop(event)) {
(event.target as HTMLElement).closest('.song-item')?.classList.add('droppable')
event.dataTransfer!.dropEffect = 'move'
}
return false

View file

@ -33,6 +33,8 @@ export const useDraggable = (type: DraggableType) => {
return
}
event.dataTransfer.effectAllowed = 'copyMove'
let text: string
let data: any