rniemeyer / knockout-sortable

A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
MIT License
548 stars 128 forks source link

Using droppable next to a sortable #187

Open derrickb opened 7 years ago

derrickb commented 7 years ago

I have a setup where I have a droppable adjacent to a sortable, both bindings provided by knockout-sortable, and both bound to the same observables. My UI is sort of like a file explorer where the sortable section has a header/handle above it which is a droppable target.

I need the sortable drop to be canceled if the item is hovering over the droppable element. However, since the item is close enough to the sortable to be dropped there, both appear to try to accept the item which results in duplicate entries being pushed to the observable array.

Any tips on how to handle this situation? Searches on google turn up possible solutions for a plain jQuery approach, but in my case it isn't enough to account for just the nodes themselves.