angular-sortable-view icon indicating copy to clipboard operation
angular-sortable-view copied to clipboard

closestElement breaks when used w/ angular-ui/ui-select

Open bgentry opened this issue 10 years ago • 1 comments

So the angular-ui/ui-select project does something a little unsavory and sets angular.element.prototype.closest to their own function. Unfortunately, their function uses an unconventional API for this function that returns a single object, rather than an array: https://github.com/angular-ui/ui-select/blob/55ae88bc15579bde92982e4feee825d110c440fa/src/common.js#L66-L83

This causes angular-sortable-view to blow up when calling closestElement()[0] because the returned object is not an array.

While I think the ui-select project is definitely doing something uncool here, I'm also curious if angular-sortable-view even needs to care whether angular.element.prototype.closest is defined. AFAICT everything should still work if you just drop the first part of the || here.

For now, my fix is to load angular-sortable-view before ui-select =/

Thoughts?

/cc @visnup

bgentry avatar Apr 24 '15 18:04 bgentry

+1. Having the same issue. Thanks for your advice @bgentry its resolved for now

n2sandhu avatar Jun 14 '16 03:06 n2sandhu