Skip to content

fix(ContentNavigation): prevent toggling disabled parent items#6122

Merged
benjamincanac merged 4 commits intonuxt:v4from
SusithD:fix/content-navigation-disabled-parent-trigger
Mar 20, 2026
Merged

fix(ContentNavigation): prevent toggling disabled parent items#6122
benjamincanac merged 4 commits intonuxt:v4from
SusithD:fix/content-navigation-disabled-parent-trigger

Conversation

@SusithD
Copy link
Copy Markdown
Contributor

@SusithD SusithD commented Mar 1, 2026

🔗 Linked issue

N/A (no linked issue)

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

ContentNavigation parent items with children were still interactive when link.disabled was set, so users could toggle open/closed sections that appeared disabled.

This PR fixes that by:

  • passing :disabled="!!link.disabled" to AccordionItem for parent links
  • applying disabled trigger UI state when link.disabled is true
  • adding a behavior test to ensure clicking a disabled parent does not change its open/closed state

This is a non-breaking bug fix and aligns parent-link behavior with disabled leaf-link behavior.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@SusithD SusithD requested a review from benjamincanac as a code owner March 1, 2026 07:45
@github-actions github-actions Bot added the v4 #4488 label Mar 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 385b3127-d3b1-4859-a34d-43bf9b202376

📥 Commits

Reviewing files that changed from the base of the PR and between dc3c378 and 48fe6bb.

⛔ Files ignored due to path filters (1)
  • test/components/content/__snapshots__/ContentNavigation.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • test/components/content/ContentNavigation.spec.ts

📝 Walkthrough

Walkthrough

The PR adds per-item disabled support to the navigation system. A playground fixture marks the top-level "Theme" navigation entry with disabled: true. The runtime component ContentNavigation.vue now binds :disabled="!!link.disabled" to AccordionItem and combines per-link and component-level disabled states for AccordionTrigger (disabled becomes !!link.disabled || disabled). The test fixture was updated to set disabled: true on a navigation entry used by ContentNavigation.spec.ts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: preventing toggling of disabled parent items in ContentNavigation, which aligns with the core changes made.
Description check ✅ Passed The description is well-related to the changeset, explaining the bug, the fixes applied, and the testing approach, though test code additions are not fully detailed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 1, 2026

npm i https://pkg.pr.new/@nuxt/ui@6122

commit: 48fe6bb

@benjamincanac benjamincanac merged commit 0f1074f into nuxt:v4 Mar 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants