Fixed #36423 -- Prevented filter_horizontal buttons from intercepting form submission.

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

@@ -164,6 +164,7 @@ answer newbie questions, and generally made Django that much better:
Bhuvnesh Sharma <bhuvnesh875@gmail.com>
Bill Fenner <fenner@gmail.com>
Bjørn Stabell <bjorn@exoweb.net>
Blayze Wilhelm <https://github.com/blayzen-w>
Bo Marchman <bo.marchman@gmail.com>
Bogdan Mateescu
Bojan Mihelac <bmihelac@mihelac.org>