Skip to content

Commit cf91206

Browse files
committed
Fix issue with has_many nested_input
The JS here is now scoping down the selector to the containing fieldset, rather than the whole document
1 parent 00fb5fd commit cf91206

File tree

1 file changed

+1
-1
lines changed
  • app/assets/javascripts/activeadmin_addons

1 file changed

+1
-1
lines changed

app/assets/javascripts/activeadmin_addons/all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@
419419
if (!!parent) {
420420
var parentSelectorId = "#" + model + "_" + parent;
421421
if (!$(parentSelectorId).length) {
422-
parentSelectorId = $(container).find("*[id*=" + parent + "]")[0];
422+
parentSelectorId = selectInstance.closest("fieldset.inputs").find("*[id*=" + parent + "]")[0];
423423
}
424424
var parentSelector = $(parentSelectorId)[0];
425425
$(parentSelector).on("select2:select", setParentValue);

0 commit comments

Comments
 (0)