From c0ed44932e05e1e86a1e23f29e9b97dd924f79af Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 30 Jan 2018 15:18:52 +0800 Subject: [PATCH] fix[dragTable]: fixed bug in Firefox --- src/views/example/table/dragTable.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/views/example/table/dragTable.vue b/src/views/example/table/dragTable.vue index 5534f2f8..9e411e64 100644 --- a/src/views/example/table/dragTable.vue +++ b/src/views/example/table/dragTable.vue @@ -110,6 +110,11 @@ export default { const el = document.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] this.sortable = Sortable.create(el, { 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 => { const targetRow = this.list.splice(evt.oldIndex, 1)[0] this.list.splice(evt.newIndex, 0, targetRow)