fix(ContentNavigation): prevent toggling disabled parent items#6122
fix(ContentNavigation): prevent toggling disabled parent items#6122
Conversation
📝 WalkthroughWalkthroughThis 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)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
commit: |
🔗 Linked issue
N/A (no linked issue)
❓ Type of change
📚 Description
ContentNavigationparent items withchildrenwere still interactive whenlink.disabledwas set, so users could toggle open/closed sections that appeared disabled.This PR fixes that by:
:disabled="!!link.disabled"toAccordionItemfor parent linkslink.disabledis trueThis is a non-breaking bug fix and aligns parent-link behavior with disabled leaf-link behavior.
📝 Checklist