[wp-trac] [WordPress Trac] #53510: The category block lacks a label when displayed as dropdown

WordPress Trac noreply at wordpress.org
Fri Jun 25 10:11:49 UTC 2021


#53510: The category block lacks a label when displayed as dropdown
---------------------------+-----------------------------
 Reporter:  Chouby         |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:  5.0
 Severity:  normal         |   Keywords:
  Focuses:  accessibility  |
---------------------------+-----------------------------
 The category block is supposed to replace the category widget, however the
 accessibility label is missing in the block.

 Here is the interesting part of the widget output:
 {{{
 <form action="http://monsite.com" method="get">
 <label class="screen-reader-text" for="cat">Categories</label>
 <select name="cat" id="cat" class="postform">
         <option value="-1">Select Category</option>
         <option class="level-0" value="277">Cat</option>
         <option class="level-0" value="1">Uncategorized</option>
 </select>
 </form>
 }}}
 An acessibility label is present.

 Here is the output for the corresponding block (I removed the javascript
 part as it is useless for the demonstration):
 {{{
 <div class="wp-block-categories-dropdown wp-block-categories">
 <select name="cat" id="wp-block-categories-1" class="postform">
         <option value="-1">Select Category</option>
         <option class="level-0" value="277">Cat</option>
         <option class="level-0" value="1">Uncategorized</option>
 </select>
 </div>
 }}}
 There is no accessibility label.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53510>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list