-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: prevent accordion toggle button overflow at full width #71446
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
fix: prevent accordion toggle button overflow at full width #71446
Conversation
t-hamano
left a comment
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.
Thanks for the PR
I think adding the overflow-x: hidden to the header will cause the outline to disappear when the header button is focused.
It's a good idea to use the .accordion-content__toggle selector.
|
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. |
t-hamano
left a comment
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.
LGTM 👍
vinay070403
left a comment
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 E2E test site-editor-url-navigation.spec.js is failing on GitHub Actions at line 44 due to a TimeoutError. Playwright cannot find or click the button For a specific item within 10s.
Possible reasons: the button is not rendered yet, the selector changed, or CI is slower than local.
Next steps: review the button’s presence, consider increasing timeout, or add waitFor before clicking to ensure stability.
|
@vinay070403 The instability of the E2E tests is completely unrelated to this PR. |
|
@mikachan Thanks for noticing!
Yes, this seems to be the best approach. |
|
Sorry, I’m not sure how I missed it. Let me double-check. Should I create a new PR with the fix and reference this PR in it? |
No problem at all. A new PR with a reference to this one sounds good! |


What?
Closes #71437
Fixes the accordion toggle button overflow issue when the accordion block is set to full width alignment.
Why?
When an Accordion block is set to full width and the Accordion Header is clicked to expand the panel, the rotated toggle button element overflows horizontally, causing an unwanted horizontal scrollbar to appear. This creates a poor user experience and visual inconsistency.
The issue was occurring because the accordion heading container didn't have proper overflow handling for the rotated toggle icon.
How?
Added
overflow-x: hiddento the.accordion-content__toggleCSS selector. This prevents the rotated toggle button from causing horizontal overflow while maintaining the visual rotation effect.Testing Instructions
Screenshots or screencast
Before
After