Open ianmh opened 8 years ago
So I have narrowed down the issue to this piece of code. The event.stopPropagation(); is preventing events from registering with Bootstrap UI dropdowns. I have removed this line in my code but I'm not sure of the implications.
I should also add that not only do they work inside draggable elements now, but also when you click on a draggable element Bootstrap drop downs now properly close if they were open. I use a Bootstrap dropdown to also add draggable elements, before this change they would not close if you clicked on a draggable element.
/**
* When the element is clicked we invoke the callback function
* specified with the dnd-selected attribute.
*/
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();
});
This issue is fixed with this pull request by rysilva.
Update: Correction, this does not fix the issue.
Same here, @ianmh any workarounds?
@Den-dp I can't seem to duplicate the issue I was having anymore, but I have used dnd-nodrag attribute on the dropdowns. This might fix it.
It's still pretty simple to reproduce http://plnkr.co/edit/nuQ8QQr3NsSPv6Cs1N8G?p=preview
Your example works for me, although they don't toggle / close, is that the issue?
Edit: I'm using a really old version of bootstrap and dropdown-toggle is working for me.
although they don't toggle / close, is that the issue?
Yes, this is my issue.
I'm using a really old version of bootstrap and dropdown-toggle is working for me.
Hey, but what about living on the bleeding edge? 😉
Any updates on this?
I'm assuming this is because the Bootstrap dropdowns use list elements. Is there a workaround for this?