﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35277	"Issue with the new ""formset:added"" event"	Bryant Glisson	nobody	"We have certain custom widgets that need to be initialized when a new form is added to an inline. Previously, this event was triggered by the following:
{{{
$(document).trigger(""formset:added"", [row, options.prefix]);
}}}
We could then use jQuery's ""on"" method to add whatever callbacks needed to be executed. Most importantly, the ""row"" that was added could be was passed to the callback, making it very easy to do what we needed to that particular row. In 5.0, this was eliminated, and we have the following code instead:
{{{
row.get(0).dispatchEvent(new CustomEvent(""formset:added"", {
  bubbles: true,
  detail: {
    formsetName: options.prefix
  }
}));
}}}
Not sure what the rational for this change was, but would really appreciate if you all could at least include the ""row"" in the detail passed here, or preferably revert to the previous code.

Source is below:
https://github.com/django/django/blob/c4df2a77761a1ae392eb5c4803b5712803d5239f/django/contrib/admin/static/admin/js/inlines.js#L91C24-L91C37"	Cleanup/optimization	closed	contrib.admin	5.0	Normal	invalid		Claude Paroz	Unreviewed	0	0	0	0	0	0
