Skip to content

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

Open
SusithD wants to merge 1 commit intonuxt:v4from
SusithD:fix/content-navigation-disabled-parent-trigger
Open

fix(ContentNavigation): prevent toggling disabled parent items#6122
SusithD wants to merge 1 commit intonuxt:v4from
SusithD:fix/content-navigation-disabled-parent-trigger

Conversation

@SusithD
Copy link

@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
Contributor

coderabbitai bot commented Mar 1, 2026

📝 Walkthrough

Walkthrough

This change implements disabled state handling for navigation items in a content navigation component. The playground example adds a disabled flag to the Theme navigation item and introduces a default-open prop. The runtime component propagates per-link disabled states to both accordion items and triggers, ensuring items respect both per-link and component-level disabled conditions. A new test verifies that disabled parent items with children remain non-interactive when clicked.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing toggling of disabled parent items in ContentNavigation, which is the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly explains the bug being fixed, the specific changes made, and provides implementation details that align with the code changes.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

pkg-pr-new bot commented Mar 1, 2026

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

commit: a1c5593

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.

1 participant