The body summary description label an attribute in the 'bootstrap' theme, not an element, however the core claro theme does render this as an element. Yet the bootstrap theme still renders the aria-describedby attribute for the related label.
This causes an aria reference missing error in w3c.
Example screenshot:
This is how it looks rendered by claro theme

However, with bootstrap, the text is a tooltip.
I have provided a workaround to pass wcag testing.
Basically removes the aria-describedby attribute from a specific summary element, in this case body summary (for example)
function bootstrap_preprocess_textarea(&$variables) {
if (is_object($variables['attributes'])) {
$attribute_obj = $variables['attributes'];
$attr_array = $attribute_obj->toArray();
if (isset($attr_array['aria-describedby'])) {
if ($attr_array['aria-describedby'] == 'edit-body-0-summary--description') {
$attribute_obj->removeAttribute('aria-describedby');
$variables['attributes'] = $attribute_obj;
}
}
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| body_summary_label.png | 18.79 KB | joseph.olstad |
Issue fork bootstrap-3156759
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joseph.olstadthe problem doesn't appear to be with the twig but somewhere in the preprocessing or before for form element input
compare claro with bootstrap:
Claro twig:
Bootstrap twig:
templates/input/form-element.html.twig
Appears that description.content is empty or has incorrect values for bootstrap,
but claro description.content has the correct information.
Comment #3
narendra.rajwar27@joseph.olstad, Checked by installing the bootstrap as administration theme. Seems like the summary description label in bootstrap becomes
data-original-title="Leave blank to use trimmed value of full text as the summary."hovering the summary field and it shows the Description label as
data-original-titleComment #4
joseph.olstadOur solution to pass wcag testing is pretty rudementary.
So here's the workaround to pass wcag, basically removing the aria-describedby attribute from that element
Comment #5
joseph.olstadComment #6
joseph.olstaddata-original-title is an attribute, not a label
the aria-describedby attribute refers to a label that is not rendered.
see workaround in comment #4
Comment #7
joseph.olstadComment #8
joseph.olstadComment #9
markhalliwellNo MR or patch.
Comment #12
immaculatexavier commentedComment #13
immaculatexavier commentedComment #14
immaculatexavier commentedDone MR in accordance to #4 & #9
Comment #15
joseph.olstad@immaculatexavier, thanks for working on this however I believe the Merge Request was accidentally merging into 8.x-4.x instead of the intended 8.x-3.x
it looks like a huge plethora of changes , perhaps edit this MR to merge into 8.x-3.x instead of 8.x-4.x or else please explain what you're trying to do?
Comment #16
hatuhay commented