WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

Details block: use summary content as default label #67217

Closed dougwollison closed 5 hours ago

dougwollison commented 7 hours ago

What?

Allows the Details block to use it's summary attribute as the block label by default, similar to the Heading block.

Why?

The Details block has a viable attribute to use as the default label, and in use cases where there are dozens on a page, it makes the List View more usable.

How?

Defines custom __experimentalLabel handler to the Details block. Unsure if the accessibility label should be prefixed with "Details. " or not, tried to match the approach of the Heading block.

Testing Instructions

  1. Open the editor
  2. Add a Details block, give it a summary value
  3. Open List View, confirm summary is being used as the label
github-actions[bot] commented 7 hours ago

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dougwollison <dougwollison@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.