Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ARIA attributes to Inputs

See original GitHub issue

Issue Description

Is your feature request related to a problem? Please describe. We want to be able to grab/access invalid input elements in the DOM and (automatically) scroll the input into view.

Describe the solution you’d like Add aria-errormessage and aria-invalid attributes to input elements. Such that if inputs are invalid we have aria-invalid="true" otherwise aria-invalid="false"

Describe alternatives you’ve considered A previous approach was to look for element/class names which could easily break the implementation if either of those gets updated

Additional context This is in relation to this PR which is to automatically scroll to error fields when users submits an invalid form.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

emmenkocommented, Jan 27, 2022

Yes sorry I wasn’t so clear.

The aria attributes will go to the input but also the error field message should have the correct identifier to be referenced by the aria-errormessage attribute.

tdeekenscommented, Jan 27, 2022

Thanks for the issue. Upon first glimpse I guess we could add aria labels based on the hasError prop. We however don’t seem to have a error message at hand in the component so we could allow forwarding it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ARIA: input role - Accessibility - MDN Web Docs
ARIA : input role. The input abstract role is a generic type of widget that allows user input. Note: The input role is...
Read more >
This specification defines the authoring rules (author conformance requirements) for the use of Accessible Rich Internet Applications (WAI-ARIA) ...
Read more >
aria-input-field-name - Accessibility Insights
An ARIA input field is a custom control that allows users to provide text input. ARIA input fields are identified by the following...
Read more >
aria-label - examples and best practices - Aditus
interactive elements: such as a (when href attribute is present), audio and video (when controls attribute is present), input , select , button...
Read more >
What the Heck is ARIA? A Beginner's Guide to ARIA ... - Lullabot
ARIA is a set of attributes you can add to HTML elements that define ways to make web content and applications accessible to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found