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
screenshot showing 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;
      }
    }
  }
}
CommentFileSizeAuthor
body_summary_label.png18.79 KBjoseph.olstad

Issue fork bootstrap-3156759

Command icon 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

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

the 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.

narendra.rajwar27’s picture

Issue summary: View changes
StatusFileSize
new72.7 KB

@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-title

joseph.olstad’s picture

Issue summary: View changes

Our 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

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;
      }
    }
  }
}

joseph.olstad’s picture

Title: The body summary description label is not rendered with 'bootstrap' theme, however the core claro theme does render this. » unreferenced aria-describedby - textarea, related to missing body summary description label
joseph.olstad’s picture

data-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

joseph.olstad’s picture

Title: unreferenced aria-describedby - textarea, related to missing body summary description label » unreferenced aria-describedby - textarea, related body summary description label
Priority: Normal » Minor
Issue summary: View changes
Status: Active » Needs review
joseph.olstad’s picture

Issue summary: View changes
markhalliwell’s picture

Status: Needs review » Active

No MR or patch.

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

immaculatexavier’s picture

immaculatexavier’s picture

Status: Active » Needs review

Done MR in accordance to #4 & #9

joseph.olstad’s picture

@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?

hatuhay’s picture

Status: Needs review » Closed (won't fix)