feat(pds-dropdown-menu): allow raw anchor and button elements#661
feat(pds-dropdown-menu): allow raw anchor and button elements#661pixelflips wants to merge 4 commits intomainfrom
Conversation
✅ Deploy Preview for pine-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThis pull request extends the pds-dropdown-menu component to support raw HTML anchor and button elements alongside component-based menu items. The changes include documentation guiding usage of mixed element types, SCSS styling for the raw elements, component logic updates to handle validation, keyboard navigation, and disabled states for both component and raw items, and corresponding test updates verifying the new functionality and modified error handling behavior. 🚥 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)
Comment |
Description
Relaxes
pds-dropdown-menuvalidation to allow raw<a>and<button>elements alongsidepds-dropdown-menu-itemcomponents.Why is this needed?
Consuming applications (like Kajabi-products) using Rails/Turbo need to use
link_tohelpers with framework-specific data attributes (data-method,data-remote,data-turbo-*) that require native browser event handling. These attributes don't work through Shadow DOM because frameworks like Rails UJS and Turbo can't intercept events on elements inside shadow roots.This change allows developers to mix standard
pds-dropdown-menu-itemcomponents with raw elements for edge cases that need native browser behavior.Changes
<a>and<button>elements now pass validation alongside existing menu items::slotted()for raw elementsTechnical Notes
::slotted()cannot style pseudo-classes like:hoveror:focus, so consuming apps must add their own CSS for those states (documented with examples)aria-disabled="true"for anchors anddisabledattribute for buttonspds-dropdown-menu-itemusage unchangedFixes DSS-134
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: