Opened 3 years ago

Closed 3 years ago

#33235 closed Cleanup/optimization (fixed)

Remove "for = ..." from MultiWidget's <label>.

Reported by: Maxim Danilov Owned by: David Smith
Component: Forms Version: 3.2
Severity: Normal Keywords: accessibility, forms, wcag
Cc: Thibaud Colas, David Smith, Tom Carrick Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The instance from Raw MultiWidget class generate id_for_label like f'{id_}0'
It has not sense.

For example ChoiceWidget has self.add_id_index and I can decide it myself, how I will see label_id - with or without index.

I think, it is better to remove completely id_for_label method from MultiWidget Class.

Change History (5)

comment:1 by Mariusz Felisiak, 3 years ago

Cc: Thibaud Colas David Smith Tom Carrick added
Keywords: accessibility forms wcag added
Summary: MultiWidget id_for_labelRemove "for = ..." from MultiWidget's <label>.
Triage Stage: UnreviewedAccepted

I agree that we should remove for from MultiWidget's <label> but not because "It has not sense" but to improve accessibility when using a screen reader, see also #32338. It should be enough to return an empty string:

def id_for_label(self, id_):
    return ''

comment:2 by David Smith, 3 years ago

Owner: changed from nobody to David Smith
Status: newassigned

comment:3 by Jacob Walls, 3 years ago

Has patch: set

comment:4 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In c6c6cd3:

Fixed #33235 -- Removed "for = ..." from MultiWidget's <label>.

This improves accessibility for screen reader users.

Note: See TracTickets for help on using tickets.
Back to Top