Skip to content

Commit

Permalink
Initialize all items on DOMNodeInserted and don't exclude prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasyl authored and jpic committed Nov 22, 2019
1 parent 10affe2 commit 7e9e88a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dal/static/autocomplete_light/autocomplete.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ element was cloned with data - which should be the case.
});

$(document).bind('DOMNodeInserted', function (e) {
$(e.target).find('[data-autocomplete-light-function=select2]:not([id*="__prefix__"])').each(initialize);
$(e.target).find('[data-autocomplete-light-function=select2]').each(initialize);
});
}

Expand Down

1 comment on commit 7e9e88a

@raphaelyancey
Copy link

@raphaelyancey raphaelyancey commented on 7e9e88a Apr 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dwasyl, after hunting a bug that created two select2 combo-boxes instead of one when clicking Add new ... on an inline, I've found that [data-autocomplete-light-function=select2]:not([id*="__prefix__"]) fixes it. Can you provide me some context on why you got rid of it? Thanks you!

EDIT: oops, just saw the PR. Nevermind.

Please sign in to comment.