Skip to content

Fix - Submenu caret icon never flips direction when toggled - #149

Open
deepench wants to merge 1 commit into
developfrom
fix/duplicate-site-navigation-id-caret-toggle
Open

deepench wants to merge 1 commit into
developfrom
fix/duplicate-site-navigation-id-caret-toggle

Conversation

@deepench

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request:

Follow-up from a review comment on this same repo's #138, which noticed the dropdown arrow icon in the mobile menu didn't seem to work as expected. On closer inspection, the submenu itself already opened and closed correctly when tapping the arrow - the only thing not working was the arrow icon itself, which never visually flipped direction (right-pointing to down-pointing) after being tapped. This fix corrects that. Same fix applied to Spacious Pro's copy of this file.

How to test the changes in this Pull Request:

  1. Make sure a menu with at least one dropdown item is assigned to the Primary Menu location, and the new responsive mobile menu setting is turned on (Customize > Header > Primary Menu).
  2. View the site on a narrow/mobile screen width and open the mobile menu.
  3. Tap the arrow next to a menu item that has a dropdown.
  4. The submenu should expand, and the arrow icon should now point downward. Tap it again - the submenu should collapse and the arrow should point right again.

Types of changes:

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (modification of the currently available functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Other information:

  • Have you added an explanation of what your changes do and why you would like us to include them?
  • Have you successfully ran tests with your changes locally?
  • Have you updated the documentation accordingly?

Changelog entry

Fix - Submenu caret icon never flips direction when toggled.

The sub-toggle click handler looked for a child matching ".sub-toggle .fa",
but inside the handler `this` already is the .sub-toggle element itself, not
a container of one - so the selector never matched anything and
toggleClass() silently ran on an empty set. The submenu itself opened and
closed correctly (a separate call), only the caret's own direction
(caret-right/caret-down) never updated. Fixed by matching the icon's actual
direct child selector, ".fa".

Verified live in both themes: before the fix, clicking the caret expanded
the submenu but the icon class never changed; after, it flips
fa-caret-right <-> fa-caret-down correctly in both directions.

Also checked and ruled out a previously-suspected duplicate id="site-navigation"
theory: header.php's two spacious_main_nav() call sites are wrapped in
genuinely mutually exclusive conditions (spacious_header_display_type ===
'four' vs !== 'four'), so only one nav ever renders - confirmed with 0
duplicates under both settings, live. Nothing to fix there.
@tg-autopilot
tg-autopilot requested a lite review from Copilot September 25, 2026 09:51
@github-actions

Copy link
Copy Markdown

QA suite — refused, no regression spec

This PR changes product source but adds no spec, so the suite was
refused before booting WordPress — running it just to report the same
thing at the end costs runner minutes for nothing. Run
/claudegrill:verify-fix locally and let write-spec add the guard
to this branch, then push again.

Source files changed with no matching spec
js/spacious-custom.js

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The submitted selector change does not address the reported caret-toggle failure.

Review effort: Lite
Findings: None

What changed in this PR

Fixes the mobile submenu caret so its direction changes when toggled.

Changes:

  • Updates the jQuery selector used for caret class toggling.
File Summary
js/​spacious-custom.js Selector change is behaviorally equivalent to the existing code and does not resolve the reported caret-toggle failure.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@deepench
deepench requested a review from subin-shk September 25, 2026 10:13
@deepench deepench self-assigned this Sep 25, 2026
@deepench deepench added the bug label Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants