bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
21.89k stars 1.97k forks source link

how to get mirror element? #512

Closed keyiis closed 6 years ago

keyiis commented 6 years ago

I want prevent drop in accepts method,i need judge the mirror element's previousElementSibling,so how can i get mirror element in accepts method?

accepts: (el, target, source, sibling)=> {
     return !(mirror element).previousElementSibling.classList.contains('add-item-btn');
}
renannobile commented 6 years ago

You could try using pure JS:

document.querySelector('.gu-mirror').previousElementSibling.classList.contains('add-item-btn');

keyiis commented 6 years ago

@renannobile thks reply!