React-beautiful-dnd: onDragEnd not called if drop animation translate does not move the draggable

Created on 8 Feb 2020  路  1Comment  路  Source: atlassian/react-beautiful-dnd

Expected behavior

onDragEnd should be called after an items drop animation finishes.

Actual behavior

onDragEnd is not called, if the drop animation does not move the Draggable with transform: translate.

Steps to reproduce

Get the transform: translate property of the Draggable before it is dropped and overwrite the transform value in provided.draggableProps.style. This can be achieved, for example, by adding a second ref to the element inside of the Draggable.

Suggested solution?

I did not find any logic in the code that might cause this. How ever I'm quite new to the code base so I might have just missed it.

What version of React are you using?

16.12.0

What version of react-beautiful-dnd are you running?

12.2.0

What browser are you using?

Latest Chrome

Demo

See App.js lines 17-19 to see the issue.

  1. Drag the Draggable from the yellow Droppable to the cyan one.
  2. You should see a line appear below the "You should see stuff here when drag ends:" line.
  3. Comment out line 18 and uncomment line 19.
  4. Refresh the page inside of the editor and try it again.
  5. onDragEnd is not called.

https://codesandbox.io/s/naughty-ganguly-ildb8

Use case

I wanted to create a "trash drop" area, where I can drop things to be deleted. It won't store anything, so the default animation does not make sense.

unconfirmed-bug untriaged

Most helpful comment

I also noticed OnDragEnd gets called once you scroll in your example.

>All comments

I also noticed OnDragEnd gets called once you scroll in your example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vrg-success picture vrg-success  路  3Comments

alexreardon picture alexreardon  路  3Comments

khurram-wasim picture khurram-wasim  路  3Comments

WJKwok picture WJKwok  路  3Comments

jasonlewicki picture jasonlewicki  路  3Comments