-
Notifications
You must be signed in to change notification settings - Fork 14
fix: rename id prop to id-{tagname} format for all affected components to fix screenreader issue
#5621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 46e2f51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…eader issue Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
|
@copilot please adapt these changes to the components custom-select, custom-select-list-item, navigation, tooltip, accordion, accordion-item, tabs and tab-list components as well. |
…ion, tabs components Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Done! Extended the
All builds, tests, and checks passed successfully. The framework outputs (Angular, React, Vue, Web Components) have been regenerated with the new property names. |
|
@copilot please switch from |
Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Done! Changed the naming convention from The properties are now defined in camelCase (e.g., Updated properties:
Example usage: <!-- Angular -->
<db-input id-input="username" label="Username"></db-input>
<!-- React -->
<DBInput idInput="username" label="Username" />
<!-- Vue -->
<db-input id-input="username" label="Username"></db-input>All builds, tests, and checks passed successfully. |
id prop to id-{tagname} format for all affected components to fix screenreader issue
|
@copilot you would need to change the |
…names Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Head branch was pushed to by a user without write access
Done! Updated the showcase references in commit 46e2f51:
All in |
Proposed changes
Screenreaders fail to read accessibility text (labels, messages) from components when the
idattribute is set. This occurs because theidprop conflicts with the internal element's ID used for ARIA relationships.Solution: Rename
idprop toid-{tagname}format matching the internal HTML element. Properties are defined in camelCase in TypeScript (e.g.,idInput,idSelect) which automatically render as kebab-case HTML attributes (e.g.,id-input,id-select) across all frameworks.Form Components:
db-input,db-switch,db-checkbox,db-radio:id→idInput(renders asid-input)db-select:id→idSelect(renders asid-select)db-textarea:id→idTextarea(renders asid-textarea)Additional Components:
db-custom-select,db-tabs,db-tab-list:id→idDiv(renders asid-div)db-custom-select-list-item,db-accordion-item:id→idLi(renders asid-li)db-navigation:id→idNav(renders asid-nav)db-tooltip:id→idI(renders asid-i)db-accordion:id→idUl(renders asid-ul)Before:
After:
Implementation:
DefaultProps(e.g.,idInput,idSelect), useOmit<GlobalProps, 'id'>to exclude conflicting propertyprops.id→props.idInput(or corresponding property) in onMount hooksidprop references to use new property names (e.g.,DBSelectwithidSelect,DBTooltipwithidI)resolves #3435
Types of changes
Further comments
This is a breaking change for applications using the
idbinding on these components.Migration path:
idtoid-{tagname}in templates (e.g.,id="username"→id-input="username")idto camelCase property in JSX (e.g.,id="username"→idInput="username")The change affects all framework outputs (Angular, React, Vue, Web Components) as they're generated from the same
.lite.tsxsource files via Mitosis.Showcase updates: Updated React showcase to use new property names for
DBSelectandDBTooltipcomponents.Total components updated: 14 (6 form components + 8 additional components)
Original prompt
idattribute on db-ux custom elements breaks screenreaders #5462💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.