Skip to content
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

Properly describe form validation errors #166

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Made aria-invalid reactive to the invalid property
  • Loading branch information
lstevens98 committed Mar 5, 2024
commit 82d486c4586eee3b6cd6d87147fe198116444e33
2 changes: 1 addition & 1 deletion packages/core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class InputComponent implements ComponentInterface {
style={{
maxWidth: this.width ? `${this.width}px` : null,
}}
aria-invalid={true}
aria-invalid={this.invalid ? 'true' : 'false'}
aria-describedby={(this.hint ? this.hintId : null) + ' ' + (this.invalid ? this.errorId : null)}
/>
<admiralty-input-invalid id={this.errorId} style={{ visibility: this.invalid && this.invalidMessage ? 'visible' : 'hidden' }}>{this.invalidMessage}</admiralty-input-invalid>
Expand Down