-
Notifications
You must be signed in to change notification settings - Fork 132
mismatch between native and custom required controls #1488
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
Comments
A blind (I'm sorry, not a native English speaker + not sure what his real condition is) person calling it "not a bug" is something else. I have no sight issues apart from the need of light glasses, and the browser behaving like this bugs me to no end. But I get it, and FWIW, I agree that after 10 years the softer end (ARIA) should adapt to the behavior of the barely touchable elephant (HTML spec and implementation). |
there used to be discussions about not exposing the invalid state (for the native HTML case) if the field was "untouched"/"not dirty" (i.e. on page load before the user even got a chance to interact with the field). can't remember if that went anywhere |
Related: #1470 |
Would aligning this make things better for users or worse? |
My view on this is that the browsers have all realised that having required fields appear in an error state when a page is loaded is terrible UI - so even though the spec states that these are invalid the browsers have all chosen to ignore the spec and not render a field as invalid (visually). Why would we want to do anything different for a screen reader? If anyone is using |
while this is about CSS, worth noting https://drafts.csswg.org/selectors-4/#user-invalid-pseudo |
Seems like there is a good case to ask browser implementers to align the state exposed in the acc layer with the visual state. |
it's a bit of an odd one because the state, when you query it, should tell you whether the constraints of the field are met or not. it's only when the field is in limbo as it were that it should have a flag of "yes, it doesn't satisfy the constraints, but the user hasn't even had a chance to touch this field yet". kind of a schroedinger's cat situation. conversely, there may well be situations where even on page load, you want to explicitly denote that a field is invalid - for instance, if the page is reloaded after a failed submission. so it's one of those "damned if you do, damned if you don't" situations. |
It boggles my mind that this is the case in Chrome's Accessibility Inspector's computed properties for a text field.
The mismatch in specs leads to inconsistent support and even questionable guidance towards ARIA misuse in an effort to try bend things to meet expectations.
The result here is, be sure to respect the 1st Rule of ARIA except when it comes to the Which camp is right? Is a field that is "suffering from being missing" invalid regardless of user entry? If yes, why doesn't Side note: From a CSS perspective, yes, every browser I've tested also thinks a field with the But it feels like most users, designers, devs, and folks in the accessibility industry agree that a form on landing without user entry loaded with errors both visually and in the code isn't a great experience. Is there a missing HTML attribute here ( |
because when you go with ARIA, you as developer are responsible for exposing the invalid state as well - |
@patrickhlauke tnx!!! I'm assuming the
Here are our options:
At this stage, it's very tempting to encourage developers to not use the Is the devil in the details of the word "SHOULD" is present instead of "MUST" in the ARIA guidance? Is this a browser manufacturer, ARIA, or WHATWG thing? Is alignment possible? |
I think the easiest way to fix the problem is through screen readers. The HTML specification defines when a field is in invalid state. Visually the browsers do not show this, but they have a tooltip with a corresponding error message. The screen readers do not output this tooltip, but only that the field is incorrect. It would be better if the screen readers would output the tooltip. This is not only true for Of course, the screen readers can only do this if the browsers pass the error message in the tooltip to the Accessibility API of the operating system in the same way as |
@JAWS-test HA! Thanks for your insight :) I had no idea the tooltip was even a thing! I knew that, as a result of submission, the browser's validation message would appear, but not that on landing a secret tooltip is present. This cracks me up even more. |
Filed a bug for JAWS: FreedomScientific/standards-support#621 |
as per the HTML spec it is not an error message per se and should not be phrased as an error:
https://html.spec.whatwg.org/multipage/input.html#attr-input-title |
In my explanations and example, I am not referring to the title attribute, but to the automatic error messages generated by the browser. These are clearly error messages, since they
It is correct that the browser error messages are no longer displayed if there is a title attribute. The title attribute is always displayed even if there is no error. The fact that browsers no longer display error messages when the title attribute is used seems to be a bug in the browsers. The WHATWG example, on the other hand, suggests combining the input hint in the title with the error message from the browser:
|
Joe's opinion here, I actually prefer how ARIA handles this and how browsers interpret the ARIA approach and have created an issue w/WHATWG for consideration. What I don't prefer is to encourage engineers to use native HTML for all the things, except Will such madness be met with open arms? |
I think that ARIA does the right thing here and I think that HTML does not. Should we consider this an ARIA issue? @stevefaulkner WDYT? |
Not an ARIA issue per se, but a HTML AAM issue, I agree that it would be good to specify that the accessibility tree does not expose a required control as invalid until form submission has been attempted or until a control has been actively interacted with (data input or state change other than focus). What is required is a reliable method of doing this based on DOM property values that can be used to convey submission attempt events to the accessibility tree. |
PR created in July - w3c/html-aam#429 |
Should we transfer this issue to html-aam (which already has w3c/html-aam#394)? |
Seems like it’d be duplicative to me. I’d close this one |
y'all read my mind, tysm! 🎉 |
Uh oh!
There was an error while loading. Please reload this page.
The normative statements around when to apply
aria-invalid=true
on anaria-required=true
control is different from the observed state exposed by native control which has arequired
attributeARIA
in HTML if the required attribute is set the state of an empty input control is one of suffering from being missing
So for native HTML controls if the
required
attribute is set theinvalid
state is also set in accessibility APIs, until the control is no longer suffering from being missing, the opposite is true for aria-required and normative statements in the ARIA spec advocate advocate the opposite of native HTML behaviourThis mismatch was raised 10 years ago at the time an implementer was against aligning/changing the HTML behaviour.
Is it time the ARIA spec aligned with the HTML spec on this? Rather than advising the opposite.
The text was updated successfully, but these errors were encountered: