Hi all,
Please refer the attached file for reference. What I'm trying to do is this:
1. There are 2 custom elements x-list and x-item. x-list items contain zero or more x-item elements. x-item elements can have nested x-list elements so we can have recursively nested components.
2. The data is bound to a single x-list element on the page via MDV.
3. The users can use the purple borders on the x-items to drag and drop them on each other. A side question, why does the dragging only work with the border and not the content? Some shadow DOM limitation?
4. When an item is dropped on another, the dropped item is duplicated (via JSON.stringify then JSON.parse) and added to the target x-item element's subItems array which should cause a re-draw due to the MDV bindings and the item should get duplcated. (I also want to remove the original item once the duplication is done but haven't gotten to that yet.) This isn't working. What is happening is that the page hangs on the drop event. Having Polymer logging enabled and looking at the console, it seems that Polymer gets into some kind of an endless loop. So, my main question is, why does it hang? Is it my code or is it a Polymer bug?
Thanks in advance for any help,
Shabbir.