Skip to content

Conversation

@himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented Sep 1, 2025

What?

Closes #71436

Removes the unnecessary accordion-content__wrapper div from the Accordion Panel block and simplifies the edit and save function.

Why?

The Accordion Panel block was generating redundant HTML markup with an extra wrapper div that served no functional purpose. There was also some complexity with the save function, with manual styling extraction.

How?

Replaced manual styling extraction with the standard useBlockProps.save() pattern that automatically handles all declared block supports (color, spacing, border, typography, shadow).

Testing Instructions

  • Insert an Accordion block
  • Add content to the Accordion Panel
  • Apply various styling options like - Background colors, Text colors, Padding/margins, Borders, and border radius, Typography settings
  • Save and view the post on the frontend
  • Inspect the HTML output - verify there's no extra div
  • Confirm all styling is still applied correctly to the main block wrapper

Screencasts

Before

Screen.Recording.2025-09-01.at.23.27.38.mp4

After

Screen.Recording.2025-09-01.at.23.22.28.mp4

@himanshupathak95 himanshupathak95 marked this pull request as ready for review September 2, 2025 06:36
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

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: himanshupathak95 <[email protected]>
Co-authored-by: t-hamano <[email protected]>

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

@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin, New Block.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Accordion Affects the Accordion Block labels Sep 2, 2025
Copy link
Contributor

@t-hamano t-hamano left a 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! Can you update the Edit component as well as the save function?

@himanshupathak95 himanshupathak95 force-pushed the fix/accordion-panel-extra-div branch from 78d584b to dacc60f Compare September 3, 2025 05:28
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! Nice cleanup 👍

@t-hamano t-hamano merged commit b46df52 into WordPress:trunk Sep 3, 2025
68 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.6 milestone Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Accordion Affects the Accordion Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accordion Panel block: remove extra div

3 participants