-
Notifications
You must be signed in to change notification settings - Fork 562
Closed
Labels
bugIdentified bug which needs a fixIdentified bug which needs a fix
Milestone
Description
Issue is reproducible with examples/index.html of the repo. Create two rules, drag the first one and drop it when it overlaps the placeholder and the other rule to more or less the same degree. The drag target disappears and adding new rules no longer works.
The issue seems to be here
jQuery-QueryBuilder/src/core.js
Lines 254 to 264 in 7f25bb0
| 'move': function(e, node, group, index) { | |
| node.$el.detach(); | |
| if (index === 0) { | |
| node.$el.prependTo(group.$el.find('>' + QueryBuilder.selectors.rules_list)); | |
| } | |
| else { | |
| node.$el.insertAfter(group.rules[index - 1].$el); | |
| } | |
| self.refreshGroupsConditions(); | |
| }, |
group.rules[index - 1].$el is the node itself then insertAfter does obviously nothing. Suggested fix would be to add
if (index > 0 && node === group.rules[index - 1]) {
return;
}
If that is ok I can make an according fix.
Metadata
Metadata
Assignees
Labels
bugIdentified bug which needs a fixIdentified bug which needs a fix