Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Details block: use summary content as default label #67217

Merged

Conversation

dougwollison
Copy link
Contributor

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

Copy link

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 <[email protected]>

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

@talldan talldan added [Type] Enhancement A suggestion for improvement. [Block] Details Affects the Details Block - used to display content which can be shown/hidden labels Nov 22, 2024
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, and tests well. Thanks for the contribution!

@talldan talldan merged commit 92254bf into WordPress:trunk Nov 22, 2024
68 of 69 checks passed
@github-actions github-actions bot added this to the Gutenberg 19.8 milestone Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Details Affects the Details Block - used to display content which can be shown/hidden [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants