I'm trying to use django-autocomplete-light in a grappelli admin page within a StackedInline
.
When used on fields in the main model, autocomplete-light
fields work perfectly fine.
However in inlines they are non-functional. All I get is a gray X, that doesn't remove the model, and no field to enter text into:
And in dynamically added inlines, I can't even click into the field!:
My code:
In admin.py
class ServiceInline(MembershipInline):
model = models.Service
form = forms.MembershipInlineFormFactory(models.Service)
In forms.py
class ServiceAutocompleteForm(autocomplete_light.ModelForm):
class Meta:
fields='__all__'
model = models.Service
autocomplete_fields = ['person','position']
So it turns out this is an issue with the generated CSS, where a float in grappelli is covering the actual autocomplete inputs. This can be fixed with the following CSS rule (as long as this is included in a file used by the admin site):
.autocomplete-light-widget {
z-index:10;
}