Errors for form related controls
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 4.5k
- Forks
- 226
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 4
Description
I've been meaning to file this issue as we do need a resolution to this prior to <selectlist> shipping. HTML has a few capabilities to enable client-side validation upon form submission; such as the required attribute. UAs have full control over the anatomy and rendering since like most UI this is not standardized anywhere. For example here are a few renderings when submitted a form that is required.
A solution to this will warrant its own explainer, so that is not the goal of this issue; the purpose of this issue is to answer the following question:
Is the error related to client-side validation a part of the anatomy of the control that owns the given attribute.
To provide a concrete example, let's use <selectlist> with a straw proposal for an <error> element:
<selectlist required>
... rest of anatomy here ...
<requirederror>This field is required</requirederror>
<patternerror>The field does not match the given pattern</patternerror><!-- this won't fire in this scenario since a pattern wasn't set -->
</selectlist>
I'm personally leaning towards doing a binding solution akin to the popover API and as I noted a research document will need to be created to influence the solution but that provides the following:
- It doesn't block
<selectlist>due to potential backwards compat issues - It allows scenarios where it isn't a part of the anatomy but is positioned relative to the offending field (another need for anchor-position)
- Universal "stamping" of solutions rather than needing to replicate it for every HTML element
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the issue's example and compare the proposed anatomy approach with the popover API and anchor-position options. Research how client-side validation errors relate to form controls, then capture the resolution in the requested explainer or research document; done means the ownership or binding question is answered without blocking .
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- accessibility, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100