Skip to content

fix(web-components): remove unnecessary id property mappings in accordion-item#36060

Merged
radium-v merged 3 commits intomicrosoft:masterfrom
radium-v:users/radium-v/wc-accordion-id
Apr 28, 2026
Merged

fix(web-components): remove unnecessary id property mappings in accordion-item#36060
radium-v merged 3 commits intomicrosoft:masterfrom
radium-v:users/radium-v/wc-accordion-id

Conversation

@radium-v
Copy link
Copy Markdown
Contributor

@radium-v radium-v commented Apr 27, 2026

Previous Behavior

The BaseAccordionItem class was overriding the native id property with an @attr-decorated version that generated a unique ID via uniqueId(). This was only needed to wire up aria-controls and aria-labelledby between the heading button and the content panel inside the shadow DOM. Since those references never cross the shadow boundary, they don't need to be derived from the host element's id at all.

New Behavior

This PR removes the @attr id override and switches the template to use static internal IDs (control and panel) for the ARIA linkage. This also removes the uniqueId and toggleState imports that are no longer needed, and adds @observable to expandbutton so it participates in FAST's reactivity system.

The test should set internal properties to match the id when provided has been removed since it asserted the old coupling behavior. All remaining accordion tests pass.

I've verified via VoiceOver that screen reader support remains unaffected, with no observed changes to the output or navigation.

@radium-v radium-v requested a review from a team as a code owner April 27, 2026 02:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

Copy link
Copy Markdown
Contributor

@davatron5000 davatron5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Extremely simplified.

@radium-v radium-v force-pushed the users/radium-v/wc-accordion-id branch from b9b60b6 to d73530e Compare April 27, 2026 21:07
@radium-v radium-v merged commit 7dfa6a3 into microsoft:master Apr 28, 2026
12 checks passed
@radium-v radium-v deleted the users/radium-v/wc-accordion-id branch April 28, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants