[wp-trac] [WordPress Trac] #37648: Bind label to Plugins > Install search input field

WordPress Trac noreply at wordpress.org
Mon Aug 29 23:18:01 UTC 2016


#37648: Bind label to Plugins > Install search input field
--------------------------+--------------------------------------------
 Reporter:  mercime       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Plugins       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  accessibility, administration
--------------------------+--------------------------------------------

Comment (by mercime):

 > Because this field is labeled implicitly, adding the for and id
 attributes doesn't accomplish anything
 Hi @joedolson. Re implicit labelling, when I started improving a11y for
 projects and sites, one of my go-to references is the
 [https://developer.mozilla.org/en-
 US/docs/Web/Guide/HTML/Forms/How_to_structure_an_HTML_form#The_<label>_element
 Mozilla Developer Network] site where it states:

  A `<label>` element is bound to its widget with the for attribute. The
 for attribute references the id attribute of the corresponding widget. A
 widget can be nested inside its `<label>` element but even in that case,
 it is considered best practice to set the for attribute because some
 assistive technologies do not understand implicit relationships between
 labels and widgets.

 In addition, the [https://make.wordpress.org/core/handbook/best-practices
 /coding-standards/accessibility-coding-standards/ WordPress A11y Coding
 Standards] the information given there is that "All form inputs must
 include an '''explicitly associated'''  `<label>` element."

 So if the WP a11y team consensus is that adding `for` attributes for
 `<label>`s is useless when widgets are nested, perhaps that should be
 clarified, as I see at least many instances throughout the WP codebase
 where `for` attributes were added to `<label>`s with widgets nested. Thank
 you.

 (copy pasted most from
 https://core.trac.wordpress.org/ticket/37649#comment:6 )

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37648#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list