question-mark
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.

Html Label (in testing contexts) and a11y behavior not optimal

See original GitHub issue

Can you elaborate a bit which labels you mean exactly?

Sure, here’s a forked example of your CodeSandbox: https://codesandbox.io/s/y257p4l8z9

Edit: as a counter-example, look at antd’s own CodeSandbox to see how the DOM differs: https://codesandbox.io/s/kw79qx5w15

The label element for [name=userName] does not have a for="userName", which breaks things like react-testing-library’s getByLabelText and forces me to fallback to less optimal methods for finding and filling inputs, and breaks some browser / a11y behavior.

I have a feeling this is some sort of props issue, but honestly just have not had time to examine further.

(P.S. Thanks for making this!)

_Originally posted by @joshsmith in https://github.com/jannikbuschke/formik-antd/pull/23#issuecomment-488612356_

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
jannikbuschkecommented, May 25, 2019

Ill keep this open to also monitor the ant design issue.

1reaction
C-Higginscommented, Jun 22, 2020

It should not require setting htmlFor. Standard AntD works with just a FormItem having a name. This package just needs to pass the name field onto the FormItem as @ghola said.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling common accessibility problems - MDN Web Docs
Hopefully this article has given you a good grounding in the main accessibility problems you might encounter, and how to test and overcome ......
Read more >
Technique G208 Including the text of the visible label as part ...
When authors make sure that the visible label of a control is included, intact, in the accessible name of that control, speech input...
Read more >
How-to: Accessible heading structure - The A11Y Project
Do not use an HTML heading just to make the text appear bigger or stand out. Use heading levels like the index of...
Read more >
The intersection of markup, content and context in accessibility
Though, when I conduct accessibility reviews of designs and ... So many HTML elements, but not all come with certain semantics that surface ......
Read more >
Links - Usability & Web Accessibility - Yale University
Colorblind users may not be able to perceive color cues. Typically, pages present links as a different color than their surrounding text. Adding...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found