-
Notifications
You must be signed in to change notification settings - Fork 350
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
Spinbutton: What should aria-valuenow be when a user gives invalid input, when should it update? #704
Comments
Addendum: What should aria-valuenow be when the user deletes the text in the spinbutton? If it should be the empty string, can we adjust the following language to include a reference to that case?
|
(this is not a WG response - just some additional information) The native spinbutton in Firefox does not use valuenow but it does expose valuetext. IMO I would envision valuenow working in the same way to mozilla's valuetext implementation. |
Firefox also adds an invalid state when the input has either
Chrome also adds an invalid state when the value is outside the range. However, Chrome does more to prevent non-numerical input. The input filters out the non-numerical characters and writes the numerical characters (including hyphens, periods, and even the letter e for scientific notation) Would the WG consider adding instructions to set aria-invalid on spinbuttons when the value is invalid, either because it's nonsense or because it's outside of the specified range? |
…owed range In response to issue #704, modified the roles, states, and properties section of the spinbutton pattern in aria-practices.html. Added a bullet to the list of roles, states, and properties stating that aria-invalid is set true if it is possible for the textbox to contain a value that is not allowed.
@0ddfell0w, The APG TF discussed this in today's teleconference. The aria-valuenow, and if used, aria-valuetext, attribute should represent the current state of the control. That is, whatever is displayed should be reflected by the aria value attributes even if the displayed value is invalid. If the displayed value is invalid, then aria-invalid should be set. Note that some spinbuttons are implemented so that inputting invalid values is not possible. For instance, numeric inputs will not allow letters to be typed. So, the answers to your questions:
The aria-value-now should be set to whatever value is displayed in the spinbutton, regardless of its validity.
Good question. I would say empty based on our discussion, but a closer look at the spec reveals that an empty value is not allowed for a required property, and aria-valuenow is required on spinbutton. The simplest solution is to change the spinbutton role so that aria-valuenow is supported rather than required. To address this possibility, I have raised w3c/aria#797.
Yes, I've proposed such a change in pull request #825. |
For issue #704, per feedback from @0ddfell0w, changed wording of guidance.
Maybe we are making this more complicated than it needs to be. Jon |
@jongund, sliders have those limitations. Spinbuttons do not. I agree that an example that is the simplest possible could be helpful. But, at least in my experience, there is more variety than that. I have frequently encountered spinners that accept text input. Some are better than others at limiting input. Regardless, the APG needs to answer the questions that are not obvious from the spec ... in this case, we have several that need answers. |
…owed range (pull #825) In response to issue #704, modified the roles, states, and properties section of the spin button pattern in aria-practices.html. Added a bullet to the list of roles, states, and properties stating that aria-invalid is set true if it is possible for the textbox to contain a value that is not allowed.
Spin Button Pattern: Add aria-invalid guidance for values outside allowed range (pull #825) In response to issue #704, modified the roles, states, and properties section of the spin button pattern in aria-practices.html. Added a bullet to the list of roles, states, and properties stating that aria-invalid is set true if it is possible for the textbox to contain a value that is not allowed.
We're developing an example ARIA spin button, and we're hoping for a clarification around aria-valuenow.
From the APG:
What should the value of aria-valuenow should be when a user (for example) pastes in some invalid input. Should aria-valuenow simply not change? Should it be set back to some default when the spinbutton loses focus? Should the paste be undone by reverting to the previous value?
Thanks!
The text was updated successfully, but these errors were encountered: