#35870: Allow customization of the blank option in select dropdowns
-------------------------------------+-------------------------------------
     Reporter:  Marijke Luttekes     |                    Owner:  Thibaud
         Type:                       |  Colas
  Cleanup/optimization               |                   Status:  assigned
    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
-------------------------------------+-------------------------------------
Comment (by Marijke Luttekes):

 Thibaud suggested I take this issue once he finishes his tests and reports
 the findings to this ticket.

 I am still deciding how to fix this issue on the Python side. I intend to
 dive into the code and see what works.

 My initial idea is:

 1. Create a new global setting, `BLANK_CHOICE`, with a default,
 translatable string value (possibly ).
 2. In the `get_choices()` method, make the `blank_choice` optional.
 Default it to `None` or an empty string (I am leaning towards None).
 3. When there is no custom value for `blank_choice`, default to the Django
 setting.

 The default value may be a translatable string like  `(select an option)`
 or `-----` (multiple dashes) for backward compatibility. Due to the
 inaccessibility of dashes, we

 Idea: Could we combine dashes and parentheses in the label? So `--(select
 an option)--`? That way, we have dashes as a visual cue and parentheses to
 improve keyboard navigation and screen reader support.

 Feedback is appreciated.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35870#comment:12>
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/01070192f74fef7c-f5fd7a7a-cb29-4cd0-a513-ee5ac67166a1-000000%40eu-central-1.amazonses.com.

Reply via email to