Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 3576d8c

Browse files
committed
Changes savesNodes placeholder's detection.
Now uses exact match of palceholder class attribute. That's to handle the case that the placeholder class equals the sortable's items class.
1 parent 06895b5 commit 3576d8c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/sortable.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ angular.module('ui.sortable', [])
7777
// placeholder class was given or placeholder.element will be
7878
// undefined if a class was given (placeholder will be a string)
7979
if (placeholder && placeholder.element) {
80-
savedNodes = savedNodes.not(element.find(
81-
"." + placeholder.element()
82-
.attr('class').split(/\s+/).join('.')));
80+
// exact match with the placeholder's class attribute to handle
81+
// the case that multiple connected sortables exist and
82+
// the placehoilder option equals the class of sortable items
83+
var excludes = element.find('[class="' + placeholder.element().attr('class') + '"]');
84+
85+
savedNodes = savedNodes.not(excludes);
8386
}
8487
};
8588

0 commit comments

Comments
 (0)