Skip to content

Customize: Fix visual/DOM order mismatch of Widgets panel buttons - #13135

Closed
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65902-widgets-buttons-order
Closed

Customize: Fix visual/DOM order mismatch of Widgets panel buttons#13135
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65902-widgets-buttons-order

Conversation

@itzmekhokan

Copy link
Copy Markdown

In the Customizer's Widgets panel, the "Add a Widget" and "Reorder" buttons are laid out with CSS floats, so their DOM order (Add, then Reorder) doesn't match their visual order (Reorder, then Add); this breaks keyboard tab order, and the buttons also sit slightly out of vertical alignment.

WP_Widget_Area_Customize_Control::render_content() now wraps both buttons in a .customize-control-widgets-buttons container and outputs Reorder before Add a Widget, matching the visual order; a new flex rule in customize-controls.css replaces the floats, right-aligning and vertically centering the pair the same way the Menus panel does.

The equivalent Menus buttons have the same float-based mismatch, but that's already covered by a separate ticket and PR, so this change is limited to the Widgets panel.

Trac ticket: https://core.trac.wordpress.org/ticket/65902

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: implementing the CSS/markup fix and verifying the DOM/visual order and button alignment against the running Customizer. All changes were reviewed and validated by me.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props khokansardar, afercia.

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

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

display: flex;
justify-content: flex-end;
align-items: center;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it should use a gap: 8px; for consistency with the Nav menus buttons.
Also, we should clean up a little and remove the float: right; for these buttons that is set in customize-controls.css.

@afercia afercia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice PR, thank you.
Just needs a few minor adjustments to the CSS.

In the Widgets panel, the 'Add a Widget' and 'Reorder' buttons were
floated right, which visually reversed their DOM order and left them
misaligned. Wrap both buttons in a flex container so their DOM order
matches the visual order and they align vertically, consistent with
the Menus panel.

Fixes #65902.
@itzmekhokan
itzmekhokan force-pushed the fix/65902-widgets-buttons-order branch from a8d2626 to d5a91eb Compare August 21, 2026 09:49
@itzmekhokan

Copy link
Copy Markdown
Author

Nice PR, thank you. Just needs a few minor adjustments to the CSS.

Both done. Added gap: 8px to match the Nav menus buttons, and removed float: right from .add-new-widget/.add-new-menu-item and .reorder-toggle. I also reduced the add buttons' margin: 0 0 0 10px to margin: 0, since that margin only existed for the floats — with it in place the Nav menus buttons were actually 18px apart (10px margin + 8px gap), so both panels now sit at a real 8px.

@itzmekhokan
itzmekhokan requested a review from afercia August 21, 2026 09:53

@afercia afercia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@afercia afercia added the props-bot Adding this label triggers the Props Bot workflow for a PR. label Aug 21, 2026
@github-actions github-actions Bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label Aug 21, 2026
pento pushed a commit that referenced this pull request Aug 21, 2026
…tons.

In the Customizer > Widgets panel, the visual order of the 'Reorder' and 'Add a Widget' buttons didn't match the DOM order. For accessibility, the visual order and DOM order must match when they impact tab sequence, interaction, and meaning. Also, improves the alignment of the buttons.

Developed in #13135

Props khokansardar, joedolson, afercia.
Fixes #65902.


git-svn-id: https://develop.svn.wordpress.org/trunk@63332 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 63332
GitHub commit: 9b24d2d

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Aug 21, 2026
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Aug 21, 2026
…tons.

In the Customizer > Widgets panel, the visual order of the 'Reorder' and 'Add a Widget' buttons didn't match the DOM order. For accessibility, the visual order and DOM order must match when they impact tab sequence, interaction, and meaning. Also, improves the alignment of the buttons.

Developed in WordPress/wordpress-develop#13135

Props khokansardar, joedolson, afercia.
Fixes #65902.

Built from https://develop.svn.wordpress.org/trunk@63332


git-svn-id: http://core.svn.wordpress.org/trunk@62525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants