Skip to content

Commit 571a508

Browse files
authored
fix: avoid iOS page redirection on drag end (#84)
1 parent 8edb4c5 commit 571a508

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ class NestedSort {
208208
onDragStart(e: DragEvent): void {
209209
this.draggedNode = e.target as HTMLElement
210210
this.draggedNode.classList.add(this.classNames.dragged)
211-
e.dataTransfer?.setData('text', 'Drag started!') // Hack for Firefox!
212211
}
213212

214213
onDragOver(e: DragEvent): void {

test/main.test.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,6 @@ describe('NestedSort', () => {
215215

216216
expect(ns.draggedNode).toEqual(item)
217217
})
218-
219-
it('runs the event dataTransfer.setDate method', () => {
220-
initDataDrivenList()
221-
const item = document.querySelector('[data-id="1"]')
222-
const setData = jest.fn()
223-
item.dispatchEvent(
224-
createEvent('dragstart', {
225-
dataTransfer: { setData }
226-
})
227-
)
228-
229-
expect(setData).toHaveBeenCalledTimes(1)
230-
})
231218
})
232219

233220
describe('dragenter event', () => {

0 commit comments

Comments
 (0)