marceljuenemann / angular-drag-and-drop-lists

Angular directives for sorting nested lists using the HTML5 Drag & Drop API
MIT License
2.16k stars 713 forks source link

I want to delete item when click on X button without drag to Trash can.Help me! #461

Open TienTungs295 opened 6 years ago

TienTungs295 commented 6 years ago

http://prntscr.com/i0lw7i

BusbyActual commented 6 years ago

Hi there. I had this same issue and I found a work around. This might break nested elements as I haven't tried. If your structure is only one level deep you can comment out the click handler in the dndDraggable directive.

  // element.on('click', function(event) {
  //   if (!attr.dndSelected) return;

  //   event = event.originalEvent || event;
  //   scope.$apply(function() {
  //     $parse(attr.dndSelected)(scope, {event: event});
  //   });

    // Prevent triggering dndSelected in parent elements.
    // event.stopPropagation();
  // });
greekenour commented 5 years ago

Did you ever figure this out TienTungs295?