Opened 2 years ago

Closed 2 years ago

Last modified 12 months ago

#33504 closed Bug (invalid)

Admin autocomplete search input does not get focused on click

Reported by: Márton Salomváry Owned by: nobody
Component: contrib.admin Version: 4.0
Severity: Normal Keywords: admin autocomplete select2 focus
Cc: Carlton Gibson Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

When using autocomplete_fields I expect the autocomplete dropdown's search input to be focused when the autocomplete is open. This used to be the case before 4.0 but it is no longer the case in 4.x.

Steps to reproduce:

Expected: search input is focused.
Actual: search input is not focused.

After pip3 install django==3 and restarting the server, the select can be tested with the expected behavior.

Attachments (2)

Django 3.png (50.8 KB ) - added by Márton Salomváry 2 years ago.
Django 4.png (114.5 KB ) - added by Márton Salomváry 2 years ago.

Download all attachments as: .zip

Change History (7)

by Márton Salomváry, 2 years ago

Attachment: Django 3.png added

by Márton Salomváry, 2 years ago

Attachment: Django 4.png added

comment:1 by Mariusz Felisiak, 2 years ago

Cc: Carlton Gibson added
Resolution: invalid
Status: newclosed

This is a regression introduce in the update of admin's jQuery to 3.6.0, see ef4ef3b8f5e253f009d27952a4e75e008c9d6e5f. I don't think there is much we can do, it's an issue between two vendored libraries Select2 and jQuery. You can try to report it on their issue tracker.

in reply to:  1 comment:2 by Márton Salomváry, 2 years ago

Replying to Mariusz Felisiak:

This is a regression introduce in the update of admin's jQuery to 3.6.0, see ef4ef3b8f5e253f009d27952a4e75e008c9d6e5f. I don't think there is much we can do, it's an issue between two vendored libraries Select2 and jQuery. You can try to report it on their issue tracker.

Thanks for the quick response, will try to figure out what to report and where.

comment:3 by Márton Salomváry, 2 years ago

For reference this is the bug report in Select2 https://github.com/select2/select2/issues/5993

comment:4 by Hielke Walinga, 12 months ago

This is now fixed in the new release of jQuery 3.7.

https://github.com/select2/select2/issues/5993#issuecomment-1544538515

in reply to:  4 comment:5 by Mariusz Felisiak, 12 months ago

Replying to Hielke Walinga:

This is now fixed in the new release of jQuery 3.7.

https://github.com/select2/select2/issues/5993#issuecomment-1544538515

Great, we're going to bump jQuery to 3.7.X in Django 5.0.

Note: See TracTickets for help on using tickets.
Back to Top