Skip to content

Commit b2e3248

Browse files
committed
Use only div or li elements as placeholder.
1 parent 54bb23a commit b2e3248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jquery.sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $.fn.sortable = function(options) {
2222
return;
2323
}
2424
var isHandle, index, items = $(this).children(options.items);
25-
var placeholder = $('<' + items[0].tagName + ' class="sortable-placeholder">');
25+
var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
2626
items.find(options.handle).mousedown(function() {
2727
isHandle = true;
2828
}).mouseup(function() {

0 commit comments

Comments
 (0)