You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class SomeModelInline(InlinePermissionsMixin, nested_admin.NestedStackedInline):
model = MyModel
extra = 1
autocomplete_fields = ['type']
form = MyModelForm
When setting extra=1 the autocomplete works for the first entry (works for all which are defined with extra) , when adding another inline entry by clicking the + add button, the autocomplete field is empty. Comparing the html of these two elements, there are a lot of html tags missing.
I am using Django 4.2
The text was updated successfully, but these errors were encountered:
// here we setup a global event listener for the `formset:added` event (which is setup in `static\admin\js\autocomplete.js`)
// event to get triggered when adding a new django inline formset (by clicking the plus button below the inline formset)
(function($) {
$(document).ready(function() {
var els = document.getElementsByClassName("djn-add-handler");
const formUpdateEvent = new CustomEvent("formset:added", { "detail": "Dummy event" });
for (el of els) {
el.addEventListener("click", function () {
setTimeout(function(){
document.dispatchEvent(formUpdateEvent);
}, 250);
});
}
});
})(django.jQuery);
I have an Inline model as following:
When setting
extra=1
the autocomplete works for the first entry (works for all which are defined withextra
) , when adding another inline entry by clicking the+ add
button, the autocomplete field is empty. Comparing the html of these two elements, there are a lot of html tags missing.I am using Django 4.2
The text was updated successfully, but these errors were encountered: