Problem/Motivation

When running a tool like WebAIM, the weight selector select input has no associated label, causing accessibility issues.

Proposed resolution

Add a #title and #title_display to the generated select inputs to satisfy accessibility.

User interface changes

Adds a hidden title for select drop down when viewing row weights, when drag and drop is disabled, for accessibility.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#4 2728581-4.patch684 byteskevinquillen
#3 2728581.patch641 byteskevinquillen

Comments

kevinquillen created an issue. See original summary.

kevinquillen’s picture

I had to solve this in template.php on a recent project:

// code
      foreach (element_children($form['field_order_selector']) as $key) {
        $form['field_order_selector'][$key]['weight']['#title'] = t('Select a numeric value to re-order.');
        $form['field_order_selector'][$key]['weight']['#title_display'] = 'invisible';
      }
//code

It would be great if this was handled in views_handler_weight_selector.inc:

     $form[$this->options['id']][$row_index]['weight'] = array(
        '#type' => 'select',
        '#title' => t('Select a numeric value to re-order'),
        '#title_display' => 'invisible',
        '#options' =>  $options,
        '#default_value' => $this->get_value($row),
        '#attributes' => array('class' => array('weight-selector')),
      );
kevinquillen’s picture

StatusFileSize
new641 bytes

Title is a bit long. Attaching a patch that addresses original issue.

kevinquillen’s picture

StatusFileSize
new684 bytes

Updating patch to be consistent with core output of 'row ordering' boxes.

  • davisben committed 6a4e159 on 7.x-3.x authored by kevinquillen
    Issue #2728581 by kevinquillen: Accessibility: add a title for weight...
davisben’s picture

Status: Active » Fixed

Thanks for the patch. Committed to 7.x-3.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.