mercredi 24 décembre 2014

Polymer draggable with interact.js / shadowDOM selector


I am attempting to use the interact.js library to create a draggable Polymer event. I know there exists a core-drag-drop element, I would like to use interact.js. I am attempting to get the first example working by passing in a class to the interact object.



interact('.draggable').draggable({....


This doesn't work in Polymer as it has to access the elements shadowDOM. I have tried the following selectors:



"custom-elem::shadow .draggable"
":host-context(.draggable)"
":host(.draggable)"
"custom-elem /deep/ .draggable"
"drop::shadow .draggable"
"custom-elem::shadow .draggable"


All return null.


I also attempted to assign and pass a reference to a single object which has the .draggable class:



var x = this.shadowRoot.querySelector(".draggable");
interact(x).draggable({....


This does not work as well. Any advice?





Aucun commentaire:

Enregistrer un commentaire