fix[dragTable]: fixed bug in Firefox
This commit is contained in:
parent
a48a1bd8be
commit
c0ed44932e
|
@ -110,6 +110,11 @@ export default {
|
||||||
const el = document.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
|
const el = document.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
|
||||||
this.sortable = Sortable.create(el, {
|
this.sortable = Sortable.create(el, {
|
||||||
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
||||||
|
setData: function(dataTransfer) {
|
||||||
|
dataTransfer.setData('Text', '')
|
||||||
|
// to avoid Firefox bug
|
||||||
|
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
|
||||||
|
},
|
||||||
onEnd: evt => {
|
onEnd: evt => {
|
||||||
const targetRow = this.list.splice(evt.oldIndex, 1)[0]
|
const targetRow = this.list.splice(evt.oldIndex, 1)[0]
|
||||||
this.list.splice(evt.newIndex, 0, targetRow)
|
this.list.splice(evt.newIndex, 0, targetRow)
|
||||||
|
|
Loading…
Reference in New Issue