fix(field): respect existing aria-invalid#4765
Conversation
🦋 Changeset detectedLatest commit: de2c363 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
|
Preview deployments for this pull request: storybook - |
There was a problem hiding this comment.
Pull request overview
Updates the ds-field web component to avoid overwriting a consumer-provided aria-invalid, aligning field validation behavior with manual accessibility control.
Changes:
- Introduces an
ATTR_INVALIDconstant and updatesds-fieldto only setaria-invalidwhen it is not already present. - Replaces
VALIDATIONStracking from aWeakMapto aWeakSetsince prior attribute restoration is no longer needed. - Adds a changeset to release the fix as a patch for
@digdir/designsystemet-weband@digdir/designsystemet-react.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/web/src/field/field.ts | Stops overriding pre-existing aria-invalid and adjusts internal tracking accordingly. |
| .changeset/six-dragons-repair.md | Publishes the behavior change as a patch release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
unekinn
left a comment
There was a problem hiding this comment.
Implementation looks good to me, tested to be working in Udir's repo.
Summary
Checks
pnpm changesetif relevant)