From 8eb413371462eb5d2ea2a5b305f5954ee112c527 Mon Sep 17 00:00:00 2001 From: Ben Muschol Date: Tue, 7 May 2019 02:16:30 -0400 Subject: [PATCH] Always remove required attribute in SelectFilter2.js (#11331) Fixes bug on browsers which do support the required attribute but not the :valid pseudo-selector --- django/contrib/admin/static/admin/js/SelectFilter2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/admin/static/admin/js/SelectFilter2.js b/django/contrib/admin/static/admin/js/SelectFilter2.js index 4221778bb2..46056b8d23 100644 --- a/django/contrib/admin/static/admin/js/SelectFilter2.js +++ b/django/contrib/admin/static/admin/js/SelectFilter2.js @@ -179,11 +179,11 @@ Requires jQuery, core.js, and SelectBox.js. // This is much faster in WebKit browsers than the fallback. field.attr('required', 'required'); any_selected = field.is(':valid'); - field.removeAttr('required'); } catch (e) { // Browsers that don't support :valid (IE < 10) any_selected = field.find('option:selected').length > 0; } + field.removeAttr('required'); return any_selected; }, refresh_icons: function(field_id) {