Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 4.1 and autocomplete not working anymore on through tables fields #229

Closed
superedo73 opened this issue Oct 11, 2022 · 1 comment
Closed

Comments

@superedo73
Copy link

superedo73 commented Oct 11, 2022

Hello, I've just upgraded from Django 4.0 to 4.1 and it seems that autocomplete in many-to-many nested inlines with through tables (w/extra fields) stopped working properly.
Other autocompletes (non M2M w/through tables) seems working as before.

In 4.0 all worked like a charm but now I have only an ordinary select rendered, without any select2 hook...

<select name="testo_set-0-testo2documento_set-0-documento" id="id_testo_set-0-testo2documento_set-0-documento" class="admin-autocomplete" data-ajax--cache="true" data-ajax--delay="250" data-ajax--type="GET" data-ajax--url="/admin/autocomplete/" data-app-label="bancadati" data-model-name="testo2documento" data-field-name="documento" data-theme="admin-autocomplete" data-allow-clear="false" data-placeholder="" lang="it"> </select>

whereas before I've had a proper select2 with ajax, like

<select name="prossimo" id="id_prossimo" class="admin-autocomplete select2-hidden-accessible" data-ajax--cache="true" data-ajax--delay="250" data-ajax--type="GET" data-ajax--url="/admin/autocomplete/" data-app-label="bancadati" data-model-name="documento" data-field-name="prossimo" data-theme="admin-autocomplete" data-allow-clear="true" data-placeholder="" lang="it" data-select2-id="id_prossimo" tabindex="-1" aria-hidden="true"><option value="" data-select2-id="5"></option></select> <span class="select2 select2-container select2-container--admin-autocomplete" dir="ltr" data-select2-id="4" style="width: 758px;"><span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-disabled="false" aria-labelledby="select2-id_prossimo-container"><span class="select2-selection__rendered" id="select2-id_prossimo-container" role="textbox" aria-readonly="true"><span class="select2-selection__placeholder"></span></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>

Thank you in advance
EG

@emfrigo
Copy link

emfrigo commented Oct 11, 2022

I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants