WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 3 months ago

#53510 closed defect (bug) (fixed)

The category block lacks a label when displayed as dropdown

Reported by: Chouby Owned by:
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.0
Component: Widgets Keywords: 2nd-opinion close
Focuses: accessibility Cc:

Description

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.

Change History (11)

#1 @desrosj
4 months ago

  • Component changed from General to Widgets
  • Keywords needs-testing added

This ticket was mentioned in Slack in #accessibility by desrosj. View the logs.


4 months ago

#3 @joedolson
4 months ago

  • Keywords needs-testing removed

Looks like this needs to be reported into the Gutenberg repository; the interface appears to have lost some of the functionality previously fixed.

#5 @joedolson
4 months ago

  • Keywords 2nd-opinion added
  • Milestone changed from Awaiting Review to 5.8

It seems possible to me that the label in the block editor may have only ever been implemented in the admin, and not on the front-end. If so, that's something that will need to be addressed, but it's not a regression in the editor.

However, since this is changing what's produced on the front end for widgets, then that *is* a regression in the accessibility of the dropdown widgets, and needs to be fixed.

Looks like a change that needs to happen here:

https://github.com/WordPress/gutenberg/blob/3da717b8d0ac7d7821fc6d0475695ccf3ae2829f/packages/block-library/src/categories/index.php

Would appreciate somebody more comfortable with Gutenberg confirming this.

This ticket was mentioned in Slack in #core-editor by desrosj. View the logs.


4 months ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


4 months ago

#8 @hugod
4 months ago

I made a pull-request to fix this issue https://github.com/WordPress/gutenberg/pull/33060.

#9 @desrosj
4 months ago

  • Keywords close added

@joedolson The PR referenced above was merged into trunk in [51261]. Could you give this another round of testing to confirm the issue is resolved?

#10 @joedolson
4 months ago

  • Resolution set to fixed
  • Status changed from new to closed

Confirmed fixed in trunk. Thanks @hugod and @desrosj!

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


3 months ago

Note: See TracTickets for help on using tickets.