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
set aria-invalid to true
  • Loading branch information
lstevens98 committed Mar 1, 2024
commit 3305e0ed2b477a75c36ed29f3db6697424fac011
4 changes: 2 additions & 2 deletions packages/core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ export class InputComponent implements ComponentInterface {
style={{
maxWidth: this.width ? `${this.width}px` : null,
}}
aria-describedby={(this.hint ? this.hintId : null) + (this.invalid ? this.errorId : null)}
aria-invalid={this.invalid}
aria-invalid={true}
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>
</div>
Expand Down