diff --git a/smart_selects/static/smart-selects/admin/js/bindfields.js b/smart_selects/static/smart-selects/admin/js/bindfields.js index 295d563..99d5f81 100755 --- a/smart_selects/static/smart-selects/admin/js/bindfields.js +++ b/smart_selects/static/smart-selects/admin/js/bindfields.js @@ -61,10 +61,11 @@ initItem(chained); } - $(document).on('formset:added', function (event, $row, formsetName) { + $(document).on('formset:added', function (event, _row) { // Fired every time a new inline formset is created var chainedFK, chainedM2M, filteredM2M; + var $row = _row || $(event.target); // For the ForeingKey chainedFK = $row.find(".chained-fk");