yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.79k stars 467 forks source link

Forwards Fields #1256

Open wail-asad opened 3 years ago

wail-asad commented 3 years ago

Description:

The forwards fields doesn't send with Ajax request at some templates. After a lot of time I discover the issue. The issue in the autocomplete_light.js in yl.getForwards. This issue appear if the fields outside HTML form tag. May you please update the line form = element.length > 0 ? $(element[0].form) : $(); to make check if element[0].form != null to make a warning to user or raising an error.

jpic commented 2 years ago

Interesting, can you open a pull request with the fix that works for you for discussion and merge?