Skip to content

Request - add Widget level drag & drop #492

Description

@reubenfirmin

I found https://kvision.gitbook.io/kvision-guide/2.-frontend-development-guide/drag-and-drop pretty hard to understand. Looking at the source, it seems that this is thin shim on top of data transfer, but it doesn't work at the same level of abstraction as the rest of kvision (since we're expected to handle serialization/deserialization directly).

The other problem, I think, is that serialization happens on initial render, rather than at the start of the drag event, which is relatively expensive (and also doesn't allow for dynamic updates without updating setDragTargetData) -- i.e. there is no way to set "draggable = true" without also setting the serialized data that gets pushed into datatransfer.

It would be great to provide a set of generic (maybe inline/reified) functions that handle conversion to and from Widget subclasses.

It would also be really nice to be able to hook into some of the lifecyle events of drag and drop. I'm using dragula right now, which is sadly unmaintained; however it has a nice API that could be emulated: https://github.com/bevacqua/dragula/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions