Disable/Don't offer some drop locations on ng2-dragula

家住魔仙堡 提交于 2019-12-13 03:33:02

问题


I have some placeholder elements, which should not be used as drop location. Is there an option to disable some drop locations or to hide some drop locations? I know that you shouldn't do this

Do not add any child elements that aren't meant to be draggable

but isn't that, what accepts is for?

this.dragulaService.createGroup('cards', {
  accepts: (el, target, source, sibling) => {
    if (sibling !== null && sibling.classList.contains('invisible'))
      return false;

    return true;
  }
});

The issue is that target, and source are containers. I would need the new location as target, but the closest thing I've got is sibling (which is not what I want).

drop and over events also seem to take only containers into account.

Is there any solution for this?

Update:

Here is my workaround for this problem.

来源:https://stackoverflow.com/questions/56108033/disable-dont-offer-some-drop-locations-on-ng2-dragula

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!