Skip to content

Commit

Permalink
fix(QFile/QUploader): fix dnd on firefox and safari on macos quasarfr…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Oct 6, 2022
1 parent ae82532 commit 7e72821
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/src/mixins/file.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Platform from '../plugins/Platform.js'
import { stop, stopAndPrevent } from '../utils/event.js'
import cache from '../utils/private/cache.js'

Expand Down Expand Up @@ -182,7 +183,14 @@ export default {

__onDragLeave (e) {
stopAndPrevent(e)
e.relatedTarget !== this.$refs.dnd && (this.dnd = false)

// Safari bug: relatedTarget is null for over 10 years
// https://bugs.webkit.org/show_bug.cgi?id=66547
const gone = e.relatedTarget !== null || Platform.is.safari !== true
? e.relatedTarget !== this.$refs.dnd
: document.elementsFromPoint(e.clientX, e.clientY).includes(this.$refs.dnd) === false

gone === true && (this.dnd = false)
},

__onDrop (e) {
Expand Down

0 comments on commit 7e72821

Please sign in to comment.