aria
aria copied to clipboard
Consider creation of a fieldsize/maxlength property
HTML has a maxlength property on text and textarea. This property currently controls how many characters can be input. For instance, a PIN field limited to 4 characters.
At the present time, this is not mapped on any platform, but I can imagine a screen reader user wanting to know that a field only accepts 4 characters. This information tends to be obvious to sighted users (input stops going into the field), but might not be to users who are blind.
@jnurthen This came up today internally. What's the timeline for 1.4?
We are seeing this used more and more. The current guidance is to be exposing character count information through live regions which is an oversized hammer. This seems easily mapped into platform APIs along with the current count. This information would allow screen readers to expose the information best for their users. I have discussed with NV Access and Vispero and they are onboard with mapping these to existing IA2/UIA properties.
The UIA mapping would be the RangeValue control pattern: https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-implementingrangevalue
The IA2 mapping appears to be the IAccessibleValue::maximumValue pattern, though external confirmation would be good: https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible_value.html#a55e179b8a504a0c44049f6d4edd0bc79
ATK looks like atk_value_get_range: https://gnome.pages.gitlab.gnome.org/atk/AtkValue.html#atk-value-get-range (@joanmarie, does that look right?)
[Edited by James] I found maxValue but @cookiecrook confirmed that's for range values, not maxlength. https://developer.apple.com/documentation/appkit/nsaccessibility/attribute/1525668-maxvalue
@smhigley The ATK/AT-SPI2 value interface is intended for numeric ranges (progress bars, spin buttons, sliders, etc., etc.). For instance, in the case of a spin button that lets you select a numeric month, the range is 1 (min) - 12 (max). The maxlength would be 2. (Right?)
I'm afraid that for specifying the maximum number of characters which can be input in a text input, there's not any good API for that. So the mapping should be.... wait for it.... yet another object attribute. :grinning:
Thanks for checking and please let me know if you have any questions.
Discussion topics/summary: https://gist.github.com/smhigley/45783c28b47ef46818a4aaed3879528f
Plan going forward:
- Map html maxlength to metadata on chars remaining
- create aria-remaining-style attr to map chars remaining (including negative values)
- check with AT vendors on if they like the idea, and if they could use existing events to do useful things (e.g. bonks) with it
related: VO bonking bugzilla issue: https://bugs.webkit.org/show_bug.cgi?id=271831
Minutes from today https://www.w3.org/2024/03/28-aria-dive-minutes.html
a topic that came up today is supporting instances of where a text field needs to convey the max length, but also might allow people to type over that length (e.g., twitter allows one to type whatever they want, but if you are beyond the max length then the tweet wont be allowed to publish)