From b9336b78cf2a9a29f4934041c9e221bc68daec80 Mon Sep 17 00:00:00 2001 From: zriv Date: Thu, 26 Mar 2020 09:53:39 +0000 Subject: [PATCH] Fixed #31404 -- Changed selector-chosen's multiple attribute to HTML5 boolean syntax. --- AUTHORS | 1 + django/contrib/admin/static/admin/js/SelectFilter2.js | 2 +- js_tests/admin/SelectFilter2.test.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 8e33fc0240..69a56718d8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -954,6 +954,7 @@ answer newbie questions, and generally made Django that much better: zegor Zeynel Özdemir Zlatko Mašek + zriv A big THANK YOU goes to: diff --git a/django/contrib/admin/static/admin/js/SelectFilter2.js b/django/contrib/admin/static/admin/js/SelectFilter2.js index 8ea9bc3e47..b4f5c06803 100644 --- a/django/contrib/admin/static/admin/js/SelectFilter2.js +++ b/django/contrib/admin/static/admin/js/SelectFilter2.js @@ -95,7 +95,7 @@ Requires core.js and SelectBox.js. ) ); - var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.name); + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', '', 'size', from_box.size, 'name', from_box.name); to_box.className = 'filtered'; var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link'); clear_all.className = 'selector-clearall'; diff --git a/js_tests/admin/SelectFilter2.test.js b/js_tests/admin/SelectFilter2.test.js index 79b61c58ae..fd0f309a04 100644 --- a/js_tests/admin/SelectFilter2.test.js +++ b/js_tests/admin/SelectFilter2.test.js @@ -15,6 +15,7 @@ QUnit.test('init', function(assert) { $('.selector-available select').outerHeight() + $('.selector-filter').outerHeight(), $('.selector-chosen select').height() ); + assert.equal($('.selector-chosen select')[0].getAttribute('multiple'), ''); assert.equal($('.selector-chooseall').text(), "Choose all"); assert.equal($('.selector-add').text(), "Choose"); assert.equal($('.selector-remove').text(), "Remove");