Currently states.js just adds a "form-required" class to the dependee form element when marking it as required.
With this patch, I propose to improve this by matching the appearance of a plain Forms API required field, by adding a themable marker at the end of the corresponding label, identical by default to that defined by theme_form_required_marker.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | match-states-api-required-736182-6.patch | 1.03 KB | manjit.singh |
Comments
Comment #1
sunThis should select .form-required
Powered by Dreditor.
Comment #2
aspilicious commentedI tried this...
Comment #3
aspilicious commentedComment #4
nod_This makes sense, please reroll against 8.x
Comment #5
nod_Comment #6
manjit.singhrerolling a patch :)
Comment #7
manjit.singhComment #8
nod_Comment #9
droplet commentedIs it still an issue ? Steps to reproduce or a test module would help us to move it forward. Thanks.
Comment #12
andypostI think this issue should be refocused to make FAPI match required state set by states.js
Comment #17
andrewmacpherson commentedConsistent and robust presentation of required form inputs is important for accessibility, see WCAG principle 3.3 Input Assistance.
#6 review:
I think this trying to provide a text alternative to the asterisk, for clarity in screen readers. This approach won't work.
The title attribute is basically useless; the only users who will be able to perceive the title attribute on this asterisk span are sighted people, with a hover-capable pointer device, who are capable of pointer accuracy down to the level of individual characters.
Static forms in D8 don't put an asterisk character into the HTML markup. Instead they use a visually hidden span of text, and the Classy theme adds an asterisk with CSS.
#12: I'm agnostic about which path we take to achieve consistency, so long as there are no regressions in the accessibility of non-dynamic forms currently.
Comment #18
andrewmacpherson commentedComment #19
andrewmacpherson commentedtest post, please ignore. Something odd is going on with tags, will file an issue with the drupal.org webmasters
Comment #29
mgiffordtagging
https://www.w3.org/WAI/WCAG21/Understanding/error-identification.html