diff options
| author | Blayze <blayze@carstickers.com> | 2025-05-28 11:22:29 -0700 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2025-06-02 22:26:36 -0300 |
| commit | 37e5cc6d89b4653f05a1a00af2eb2187c907c935 (patch) | |
| tree | d77f60c4709a6419e8702f3653be7f2ffe07f005 /js_tests/admin/SelectFilter2.test.js | |
| parent | e107b8a9d39ec58a5cadcaf100128ae20b1e052c (diff) | |
[5.2.x] 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 857b1048d53ebf5fc5581c110e85c212b81ca83a.
Backport of 90429625a85f1f77dfea200c91bd2dabab57974f from main.
Diffstat (limited to 'js_tests/admin/SelectFilter2.test.js')
| -rw-r--r-- | js_tests/admin/SelectFilter2.test.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/js_tests/admin/SelectFilter2.test.js b/js_tests/admin/SelectFilter2.test.js index 8c1480d2a6..1fd46bd0ce 100644 --- a/js_tests/admin/SelectFilter2.test.js +++ b/js_tests/admin/SelectFilter2.test.js @@ -31,6 +31,7 @@ QUnit.test('init', function(assert) { assert.equal($('.selector-chosen .selector-chosen-title .helptext').text(), 'Remove things by selecting them and then select the "Remove" arrow button.'); assert.equal($('.selector-filter label .help-tooltip')[0].getAttribute("aria-label"), "Type into this box to filter down the list of available things."); assert.equal($('.selector-filter label .help-tooltip')[1].getAttribute("aria-label"), "Type into this box to filter down the list of selected things."); + assert.equal($('#test button:not([type="button"])').length, 0); }); QUnit.test('filtering available options', function(assert) { |
