#35870: Allow customization of the blank option in select dropdowns
--------------------------------------+------------------------------------
     Reporter:  Marijke Luttekes      |                    Owner:  (none)
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Forms                 |                  Version:  5.0
     Severity:  Normal                |               Resolution:
     Keywords:  accessibility         |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

 * stage:  Unreviewed => Accepted

Comment:

 Seems reasonable.

 A couple of thoughts...

 > The default current value for this option is "---------" and cannot be
 customized for the entire project at once.

 It's a module level constant so probably can be monkey patched as a
 workaround, in a settings file or a `AppConfig.ready()`:

 {{{
 from django.db.models import fields

 fields.BLANK_CHOICE_DASH = [("", "No value selected")
 }}}

 Given that this is form related, adding an attribute to the
 `FORM_RENDERER` would likely be a good candidate location, rather than a
 separate setting entirely.

 Using the form renderer would also give us a location for deprecation of
 the older option (if that is agreed on) as we did similar with the move to
 the `<div>` form templates, providing a fallback renderer during the
 deprecation period.

 I'll accept for both parts, assuming that *accessible by default* is a
 goal. Exact replacement for `-----` TBD.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35870#comment:2>
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070192d2dd38bb-778c4557-e1ce-415a-8f84-d843a1842877-000000%40eu-central-1.amazonses.com.

Reply via email to