[Django] #33504: Admin autocomplete search input does not get focused on click

24 views
Skip to first unread message

Django

unread,
Feb 8, 2022, 3:53:10 PM2/8/22
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton | Owner: nobody
Salomváry |
Type: Bug | Status: new
Component: | Version: 4.0
contrib.admin | Keywords: admin autocomplete
Severity: Normal | select2 focus
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
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:

- Clone this repo: https://github.com/salomvary/django-select2-bug
- `pip3 install django==4`
- `python3 ./manage.py runserver`
- Open http://127.0.0.1:8000/admin/myappp/thing/add/
- Sign in with username: admin, password: admin
- Click on the select next to "Other things:"

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33504>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 8, 2022, 3:53:30 PM2/8/22
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Márton Salomváry):

* Attachment "Django 3.png" added.

Django

unread,
Feb 8, 2022, 3:53:40 PM2/8/22
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: new

Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Márton Salomváry):

* Attachment "Django 4.png" added.

Django

unread,
Feb 9, 2022, 1:59:16 AM2/9/22
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: invalid

Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Carlton Gibson (added)
* status: new => closed
* resolution: => invalid


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33504#comment:1>

Django

unread,
Feb 9, 2022, 4:31:53 AM2/9/22
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Márton Salomváry):

Replying to [comment:1 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33504#comment:2>

Django

unread,
Feb 25, 2022, 7:51:17 AM2/25/22
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Márton Salomváry):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/33504#comment:3>

Django

unread,
May 12, 2023, 1:13:57 PM5/12/23
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Hielke Walinga):

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

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

--
Ticket URL: <https://code.djangoproject.com/ticket/33504#comment:4>

Django

unread,
May 12, 2023, 1:18:41 PM5/12/23
to django-...@googlegroups.com
#33504: Admin autocomplete search input does not get focused on click
-------------------------------------+-------------------------------------
Reporter: Márton Salomváry | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: admin autocomplete | Triage Stage:
select2 focus | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:4 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33504#comment:5>

Reply all
Reply to author
Forward
0 new messages