Fixed #36423 -- Prevented filter_horizontal buttons from intercepting form submission.
Some checks are pending
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run

In the admin's filter_horizontal widget, optional action buttons like
"Choose all", "Remove all", etc. were changed from `<a>` to `<button>`
elements in #34619, but without specifying `type="button"`. As a result,
when pressing Enter while focused on a form input, these buttons could
be triggered and intercept form submission.

Explicitly set `type="button"` on these control buttons to prevent them
from acting as submit buttons.

Thanks Antoliny Lee for the quick triage and review.

Regression in 857b1048d5.
This commit is contained in:
Blayze 2025-05-28 11:22:29 -07:00 committed by nessita
parent 1a74434399
commit 90429625a8
5 changed files with 56 additions and 4 deletions

View file

@ -30,3 +30,7 @@ Bugfixes
* Fixed a regression in Django 5.2 that caused a crash when using ``OuterRef``
in PostgreSQL aggregate functions ``ArrayAgg``, ``StringAgg``, and
``JSONBAgg`` (:ticket:`36405`).
* Fixed a regression in Django 5.2 where admin's ``filter_horizontal`` buttons
lacked ``type="button"``, causing them to intercept form submission when
pressing the Enter key (:ticket:`36423`).