CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Accordion: Add an "Add" button #71388
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
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +48 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think we should try this, feel it out.
It could use a code check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is looking good to me
947eef4
to
5a8cf6c
Compare
Flaky tests detected in 5a8cf6c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17321483217
|
label={ __( 'Add accordion content block' ) } | ||
onClick={ addAccordionContentBlock } | ||
> | ||
{ __( 'Add' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be mistaken, but I thought we shouldn't use different labels when a button has an actual text label, from an a11y perspective.
cc @joedolson, @t-hamano
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't use different labels when a button has an actual text label, from an a11y perspective.
This is how I understand it too. I think we should remove the label
prop (aria-label
),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I agree, I don't think we should have the label
here at all. I thought I used a pattern I found in another block, but the only other example I can see is the Gallery block, which just uses "Add" as the button text with no label. Will spin up a PR with a fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could do that as part of #71750
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, we'll address it in #71750
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR here: #71756
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, we'll address it in #71750
Ah sorry, didn't see these comments until after creating the PR 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do separate PRs. No problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If the context of the button is clear and it has visible text, it shouldn't also have a label prop. Thanks for catching this!
What?
Addresses these comments: #64119 (comment) & #64119 (comment)
Adds an "Add" button to the Accordion block.
Why?
This makes it easier to add more Accordion Content blocks to the Accordion block.
How?
Adds an "Add" button to the Accordion block toolbar:
This implementation is based on the "Add" button in the Gallery block:
Testing Instructions
Screenshots or screencast