Skip to content

[question] Can't get original sorted state on dragging end  #142

Open
@antoine-nedelec

Description

@antoine-nedelec

I would like to retrieve the final state of my draggable list, only on drag end.

I managed to call my own function like this,
setList={() => {}}
onEnd={this.props.onBundleDragAndDrop}

But I need here to check if my indexes are different, and then splice my state element twice (once to remove, and once to insert). But even when I do this, there is a "chosen" attribute inserted in my original state

So I need then to clean my state out of the "chosen" attribute.

As I customly find the end index, and then I customly clean my response, this library don't really do what I need, but isn't it supposed just to sort element and return the final state ? Can I get rid of those new indexes inserted in my state, and is there another way just to retrieve it on drag end without tweaking "setList" ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions