fix(PageCard): pass fallthrough attributes to root element#6265
fix(PageCard): pass fallthrough attributes to root element#6265faizkhairi wants to merge 1 commit intonuxt:v4from
Conversation
Add v-bind="$attrs" to the root Primitive element so that non-prop attributes (e.g. aria-selected, aria-label) are passed through to the root DOM element instead of being silently dropped. This matches the established pattern used by PricingPlan, Header, PageLogos, and other components that use inheritAttrs: false with manual $attrs binding on the root Primitive. Resolves nuxt#6247
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request adds attribute forwarding support to the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms 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: |
Description
Fixes #6247
PageCardusesdefineOptions({ inheritAttrs: false })but only spreads$attrsonto the innerULinkcomponent. This causes non-prop attributes likearia-selected,aria-label, and other ARIA attributes to be silently dropped from the root DOM element.Changes
Added
v-bind="$attrs"to the root<Primitive>element inPageCard.vue. This follows the established pattern used byPricingPlan,Header,PageLogos,DashboardNavbar, and other components that useinheritAttrs: falsewith manual $attrs binding on the root Primitive.Tests
Added two test cases to
PageCard.spec.ts:aria-selectedandaria-labelare passed through to the root elementtoprop is presentAll 5359 existing tests continue to pass.
Note
BlogPost.vueandPageFeature.vueuse the same pattern (inheritAttrs: falsewith $attrs only on ULink) and have the same issue. These can be addressed in follow-up PRs.