#30440: "required" attribute is not removed if the browser doesn't supported
":valid" pseudo-selector in SelectFilter2.js
-------------------------------------+-------------------------------------
               Reporter:  BenMusch   |          Owner:  nobody
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:             |        Version:  2.2
  contrib.admin                      |       Keywords:  admin select
               Severity:  Normal     |  selectfilter filteredselectfield
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 The code in question:
 
https://github.com/django/django/blob/stable/2.2.x/django/contrib/admin/static/admin/js/SelectFilter2.js#L175

 If an error is thrown on line 181, the attribute is never removed. This
 leads to incorrect form validation when submitting.

 I believe this would be fixed by moving the
 "field.removeAttr('required');" outside of the try/catch block

 Steps to reproduce:

 1. Use a browser which does not support :valid pseudo-selector (I am using
 Chrome 73 on Mac)

 2. Open a page with the filtered multiple select field

 3. Submit the form without making any changes

 4. The browser will erroneously preform the "Missing required element"
 validation

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30440>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.512bd2dc75413de6915999abad20f78e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to